Skip to main content
jonathan239955_stm1_stmicro_co
Associate II
June 3, 2009
Question

REAL TIME CLOCK (RTC) read problem

  • June 3, 2009
  • 2 replies
  • 741 views
Posted on June 03, 2009 at 20:51

REAL TIME CLOCK (RTC) read problem

    This topic has been closed for replies.

    2 replies

    swhite
    Associate III
    May 17, 2011
    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.

    jonathan239955_stm1_stmicro_co
    Associate II
    May 17, 2011
    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 ]