External RTC support for nRF52840 with Power-Fail timestamp feature

Hi,

We are developing a custom PCB which contains the nRF52840 MCU as the main MCU on the PCB. 
The PCB is battery powered and would need to support timekeeping even after the main batteries are missing.
For this we would add smaller backup batteries on the PCB which would power the external RTC while the main batteries are missing.
Our MCU would communicate with the RTC over I2C
We are currently looking for the RTC component which would fit our use case and decided to ask for your support.

Because of the battery capacity constraints we would the external RTC to consume an average below 2-3 µA.
For the RTC we are looking for at least time resolution in seconds while any higher resolution (hundreds of seconds, miliseconds, ...) would be more optimal.
This RTC would also need save the timestamp in resolution in seconds of when the main batteries are taken out and the RTC powering source switches to backup batteries.
This timestamp is commonly referred to in RTC datasheets as Power-Fail Timestamp.

Also because we are developing on nRF52840 with Zephyr RTOS it would be beneficial if the RTC has driver support available in Zephyr or at least a C driver solutuion.

Requirements for the external RTC:

  1. Support for I2C slave interface compatible to communicate with nRF52840 I2C master peripheral
  2. Average current consumption below 3 µA
  3. RTC timekeeping with time resolution in seconds
  4. Support for Power-Fail Timestamp with time resolution in seconds
  5. Relatively low price of the component
  6. Has Zephyr driver support or at least C driver support


Possible RTC solutions

We found an multiple RTCs that fit our use case:

,but there is no Zephyr driver support for any of them, the best C driver support can be found for RV-3028-C7 RTC.


I know Nordic Devzone forum is not the best place to pose a question regarding other RTC solutions, but we are under time pressure and we would need your support choosing the best option to integrate with nRF52840 MCU with Zephyr driver.

Also if you know of any other RTCs that would be better suited for our requirements please let us know, thank you.

Parents
  • Hi

    I'm sorry, but as we're not familiar with either of these RTC options I can't provide a suggestion for one of them over the others, and you're mostly on your own here I'm afraid.

    However, is there a specific reason you can't use the internal RTC option on the nRF52840 that uses the external 32.768kHz crystal? It should mark off all the requirements I believe, depending on what the power-fail timestamp is supposed to provide exactly.

    Best regards,

    Simon

  • Hi,

    The problem with the internal RTC solution is the time it takes to switch from standard MCU functionality to lowest power System ON mode that still powers the RTC. In that time the current consumption needed to perform this and also save the current timestamp to flash would be too great for our backup batteries to handle. 

    Here is the description of the theoretical internal RTC solution:
    When the user takes out the main batteries the nRF52840 MCU would then be powered by the backup batteries.
    To notify the MCU of the change of power supply source we would add a signal that goes high when the voltage of main batteries falls below certain threshold indicating they are missing. This signal would be connected to nRF52840 GPIO pin in which we would configure interrupt functionality to call a ISR which would save the current timestamp and put the device to lowest System OFF mode with RTC still timekeeping. This ISR would have to stop all the functions of the MCU immediately to not overload the current consumption the backup batteries can handle. This current consumption limit would be 1-5 mA.
    I don't see a way for this to happen fast enough so the backup battery voltage drop caused by current consumption of the MCU in the time the main batteries are taken out doesn't cause an MCU reset which would lose the RTC time.

    One solution we considered for this is to add a capacitor solution to the connection from main batteries which would power the MCU for a that of time when we have to put the the MCU in the lowest System ON mode when the main batteries are taken out. Unfortunately, we don't have enough space on the PCB to place a capacitor which would do a good job for this use case.

    If you have any suggestions or see any flaws in my reasoning, please let me know.    

    Best regards,
    Renato

  • Hi Renato

    Sorry about the delay, but I wanted to discuss this with a colleague with some more HW design experience than me, and I understand why the internal RTC won't work here, thank you for the clarification. For the external RTC we still can't give any specific recommendations I'm afraid.

    Regarding your capacitor solution we have some thoughts/input. The following points are mostly educated guesswork/general advice since we don't know the size of the battery you're using or what kind of backup battery you would need.

    • If your device goes into low power mode it's not a lot power that will be drawn, and you shouldn't need too large capacitors to store enough energy while switching the batteries. With a capacitor bank it should be enough to switch the battery while the device is sleeping.
    • One worry/consideration would be how fast the device goes into deep sleep, so that it doesn't eat from the capacitor bank while going into low power mode. Some trial and error will be required since this will be very use case specific and how much the application does before it goes to sleep.
    • If you had an external button that puts the device into deepsleep before the battery switch it would probably work using an internal RTC. That way it would only draw energy from the main battery until it is in deep sleep mode, then the backup battery/capacitor bank would be in use while the main battery was changed, but that would require that you make room for such a thing on your PCB.

    Note that this is mostly peculation, but we think that device in sleep mode should be able to live on a capacitor banks backup power for some time at least.

    Best regards,

    Simon

Reply
  • Hi Renato

    Sorry about the delay, but I wanted to discuss this with a colleague with some more HW design experience than me, and I understand why the internal RTC won't work here, thank you for the clarification. For the external RTC we still can't give any specific recommendations I'm afraid.

    Regarding your capacitor solution we have some thoughts/input. The following points are mostly educated guesswork/general advice since we don't know the size of the battery you're using or what kind of backup battery you would need.

    • If your device goes into low power mode it's not a lot power that will be drawn, and you shouldn't need too large capacitors to store enough energy while switching the batteries. With a capacitor bank it should be enough to switch the battery while the device is sleeping.
    • One worry/consideration would be how fast the device goes into deep sleep, so that it doesn't eat from the capacitor bank while going into low power mode. Some trial and error will be required since this will be very use case specific and how much the application does before it goes to sleep.
    • If you had an external button that puts the device into deepsleep before the battery switch it would probably work using an internal RTC. That way it would only draw energy from the main battery until it is in deep sleep mode, then the backup battery/capacitor bank would be in use while the main battery was changed, but that would require that you make room for such a thing on your PCB.

    Note that this is mostly peculation, but we think that device in sleep mode should be able to live on a capacitor banks backup power for some time at least.

    Best regards,

    Simon

Children
No Data
Related