Sony's Developer World forum

    • Home
    • Forum guidelines

    RTC part: Post-counter is 32 bit with 32768 Hz clock, and how to handle the overflow of Post-counter register

    Spresense
    2
    2
    955
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      perryfather last edited by

      @Who may concerned
      I see the CXD5602 manual, the Post-counter is 32 bit with 32768 Hz clock. So it means every 36.4 Hours, the post-counter register will be over run.

      1. May I know how Spresense handle the overflow of Post-counter register at Spresense SDK?
      2. I dont know my assumption right or wrong ? Below is my assumption.
        Will Spesense generate an interrupt when Post-counter register is overflow every 36.4 hours ? So Spresense will use this IRQ to correct the rtc saving time at ISR of this IRQ ?
      1 Reply Last reply Reply Quote
      • TE-KarlKomierowski
        TE-KarlKomierowski DeveloperWorld last edited by TE-KarlKomierowski

        @perryfather

        Thanks for rising this question.

        1. I started to look into this and can see that the interrupts are being handled by the low level drivers. But I stopped the investigation there for a while to continue on your number 2 question.,

        2. According to page 170: CXD5602 user manual the RTC has two counters.

        • 15 bit PreCounter that counts the 32,768Hz clocks, increments every 1/32768 seconds, overflows every second.

        • 32 bit PostCounter is incremented every second. A 32 bit counter can have a maximum value of 4294967295. To translate this to a human understandable time gives me something in the range of 150 years before it will overflow. 0xFFFF / (3600 x 24 x 7 x 4 x 12) = 147,95 years
          (32 bit max val / (sec/h x h/day x days/week x weeks/month x months/year))

        I know that I didn't answer your question but I doubt that this will be an issue.

        BR
        Karl

        @perryfather said in RTC part: Post-counter is 32 bit with 32768 Hz clock, and how to handle the overflow of Post-counter register:

        .
        Will Spesense generate an interrupt when Post-counter register is overflow every 36.4 hours ? So Spresense will use this IRQ to correct the rtc saving time at ISR of this IRQ ?

        1 Reply Last reply Reply Quote
        • First post
          Last post
        Developer World
        Copyright © 2021 Sony Group Corporation. All rights reserved.
        • Contact us
        • Legal