REAL TIME CLOCK (RTC) read problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2009-06-03 11:51 AM
Posted on June 03, 2009 at 20:51
REAL TIME CLOCK (RTC) read problem
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:13 AM
Posted on May 17, 2011 at 13:13
Has anyone seen an issue (and found a solution) for millisecond read greater than 999 bcd.
See attached for details. [ This message was edited by: jonathan.peterson on 03-06-2009 16:07 ]Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:13 AM
Posted on May 17, 2011 at 13:13
The RTC registers are not in BCD they're binary.
I use this code to create millisecond resolution timestamps. secs = RTC_GetCounter(); ms = 1000 * ((RTC_XTAL_FREQUENCY - 1) - RTC_GetDivider()) / RTC_XTAL_FREQUENCY; I use the Standard Peripheral Library v3.0.0 functions instead of direct register accesses.