🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Expose VL bit flag for RTC

    Features Wish List
    2
    2
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mtylerjr
      last edited by mtylerjr

      This came up on a facebook group discussion on the RTC in the Core2 and Core3

      There is a bit in the "seconds" register in the RTC's BM8563 chip that indicates that the chip has had low voltage at some point and that the internal timestamp information may be corrupted.

      However, it looks like the m5stack library (on github) for this RTC chip specifically masks out this bit when reading the timestamp information. This is sensible for getting the correct number of seconds, but it means this status bit is not visible to users.

      If the library could provide a way to read this status, and even provide it via UIFlow2, then users could check the integrity of the timestamp info of the RTC.

      Maybe a "Get System Time Integrity Flag" or "Get RTC Low Voltage Flag" or something? Then if this flag is set, the user could refresh the RTC's time to maintain accuracy.

      Just an idea.

      1 Reply Last reply Reply Quote 0
      • L
        LBertrand
        last edited by LBertrand

        It's more than just an idea, it's a good idea. They already have it in the M5 Unified library, they just need to backport it to Core2. I filed a pull request. I hope they accept it:
        https://github.com/m5stack/M5Core2/pull/138
        I thought that you could use the RTC::ReadReg method directly to read the bit, something like return Rtc.ReadReg(0x02) & 0x80;, but unfortunately the method is private.
        Hope this helps
        --Louis

        1 Reply Last reply Reply Quote 1
        • First post
          Last post