10-21-2008 09:09 AM
10-21-2008 09:57 AM
Eric,
Look in labview\Targets\ADI\Embedded\vdk\common\lv_device\rtc.c. That VI is calling the System Services function adi_rtc_GetDateTime, which returns the data from the RTC_STAT register. Here is the format of that register
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Day Counter (0–32767) Hour (cont’d)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Hour (0–23) Minutes (0–59) Seconds (0–59)
The granularity offered by that register is to the second. As a workaround, you could use the Tick Count function to get sub-second time resolution.
10-21-2008 10:06 AM
That's exactly what I'm going to try. I'm going to use the millisecond timer in conjunction with the second interrupt function from the Blackfin to "reset" the sub-second value to 0. I'll post the VI once I have it done.
Thanks Michael for the quick response!!
Eric
10-21-2008 01:45 PM
Michael,
I think I may have found a bug in the embedded implementation of the "Date/Time To Seconds" function. This is the concept I have for the fractional second portion of the RTC timestamp:
1) Set the RTC Second Callback. This will trip every second of the RTC. In the callback, set a global variable to the current ms timer value.
2) When retrieving the RTC, use difference between the Global variable set in the callback to the current value of the ms timer. This will give you the current fractional second needed in the RTC.
3) Bundle the fractional second into the timestamp.
The callback works, the calculations all work, where it fails is when I convert the date/time cluster into a timestamp using the "Date/Time to Seconds" function. This seems to throw away the fractional seconds.
I have included a little example of what I'm seeing.
10-23-2008 07:47 PM
Hey Eatherton,
I will work with Michael on this, to re-create the issue.
Will get back to you soon.