RTC Algorithm

I am experimenting with alarm wake up from deep sleep in a C6748. I would like to set an alarm some arbitrary delta from the current RTC value. To do so, I need to convert date/time to seconds since 00, add the delta, and convert back to data/time. The TRM mentions leap year support.  I assume that means 21 century. No warping back to the 20th.

What is algorithm does the RTC module use to increment all it's internal counters?

Otherwise, I have to use the RTC module like a timer and zero it out for every timing duration.

2 Replies

  • Hi Norman,

    Thanks for your post.

    First of all, it is not possible to configure the output behavior of the RTC_ALARM pin as a one second periodic pulse, however the ALARM interrupt can be used to generate a pin toggle through GPIO and the the RTC_ALARM signal behaviour is described by a diagram in the C6748 TRM (Section 9.9.3, page no. 200, under "Deep Sleep Mode" -> "Deep Sleep Sequence") as below:


    You can configure the Deep Sleep mode in both modes (externally controlled wake-up & RTC controlled wake-up). Also, please refer Section 9.7 (RTC-Only Mode) and Section 9.9 (Deep Sleep Mode) for better idea on how DEEPSLEEP pin is driven from low to high and how it begins counting valid clock cycles.

    Please refer the below E2E threads in which you can get an better understanding on the above two modes (RTC-Only mode and Deep Sleep Mode):



    I hope the above information would be useful to you.

    Thanks & regards,

    Sivaraj K

    Please click the
    Verify Answer button on this post if it answers your question.


  • In reply to Sivaraj Kuppuraj:

    I did try periodic interrupts. I set up a 1 second periodic interrupt and a 10 second alarm in the future. I then put the processor in  deep sleep. It did not wake up at 1 second. It did wake up at 10 seconds. The block diagram in TRM Section 26.1.3, Figure 26-1  would suggest that Alarm interrupts are separate from Timer interrupts. No where else in the TRM does it document where those interrupts are connected. It is implied that RTC_ALARM pin is the same line as the Alarm interrupts in the figure.

    My custom board does not have GP0[8]/DEEPSLEEP/RTC_ALARM pin connected to an external point. Next revision. Externally controlled wake-up is not at option at this moment.