Timestamp on the Logomatic v2

Hi,

What’s the easiest way to track time on the logomatic v2 ?

I don’t need time since EPOCH, (that would be nice) but just how much time has elapsed since the last time a record was written.

Thanks

H

I’m batting 0 for 3 on these forums. :wink:

Ok here is a reply to my own question. You do it like this:

//Set the time

void set_time(void)

{

PCONP |= (1<<9); //Ensure RTC is powered

CCR = 0x12; //disable RTC, set xtal flag true

//update time registers

YEAR = 2009;

MONTH = 12;

DOM = 30;

HOUR = 22;

MIN = 43;

SEC = 0;

CCR = 0x11; //enable RTC, keep xtal flag true

char debug[128];

sprintf(debug, “YEAR: %d MONTH: %d DAY: %d HOUR: %d MIN: %d SEC: %d\r\n”, YEAR, MONTH, DOM, HOUR, MIN, SEC);

}

I also found the docs for the chip:

http://www.nxp.com/documents/user_manual/UM10139.pdf

J

Hello! I would like to add a time stamp to each voltage reading recorded by the Logomatic v2 as you did. I am familiar with code, but not experienced enough to edit pre-existing code. Where do you add the code into the main.c file of the logomatic’s firmware. Do you have to edit anything else? I am very noobish when it comes to programming. Thanks.