Page 1 of 1

Data logging

Posted: Wed Jan 05, 2011 10:47 am
by nmindana
Hi, I am in the process of upgrading the event counter that I built using flowcode, I need a date stamp for the events which can
be shown as a graph using the terminal emulator on a pc. I am using PIC18F13K50 (usb enabled). Please help with ideas.

Thanks in anticipation

Indana

Re: Data logging

Posted: Wed Apr 13, 2011 10:16 am
by Benj
Hello,

You could use something similar to the FAT date stamp.
Date Format. A FAT directory entry date stamp is a 16-bit field that is basically a date relative to the MS-DOS epoch of 01/01/1980. Here is the format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the 16-bit word):

Bits 0?4: Day of month, valid value range 1-31 inclusive.
Bits 5?8: Month of year, 1 = January, valid value range 1?12 inclusive.
Bits 9?15: Count of years from 1980, valid value range 0?127 inclusive (1980?2107).

Time Format. A FAT directory entry time stamp is a 16-bit field that has a granularity of 2 seconds. Here is the format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the 16-bit word).

Bits 0?4: 2-second count, valid value range 0?29 inclusive (0 ? 58 seconds).
Bits 5?10: Minutes, valid value range 0?59 inclusive.
Bits 11?15: Hours, valid value range 0?23 inclusive.