This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: RTC retention flag

Part Number: MSP432E401Y

Hello,

We have constructed hardware where we use Vdd and Vbat. Power to Vdd goes off but not to Vbat. Then we have power to the hibernation module and the RTC is fine.

But in case we lose Vbat we are gonna lose power to HIB module and RTC. When we get power again, can we see a flag that the RTC has been lost due to power off?

I was reading the datasheet for MSP432E401Y and it says RTC registers are reset only after POR and I consider this as a POR condition. 

Regards,

Gergana

  • Hi,

    But in case we lose Vbat we are gonna lose power to HIB module and RTC. When we get power again, can we see a flag that the RTC has been lost due to power off?

      You can setup low battery detection so low battery condition can be detected before VBAT is totally lost at 0V. If your VBAT is totally lost and VDD is also turned off then the device is unpowered. Flags are volatile - meaning they cannot retain their states without power. I don't even think writing the flags to the on-chip EEprom as soon as you detect low power condition will work. It will take some time to write to EEprom but if you lost VBAT instantly then there is no power to perform this operation.  

     Please refer to the low battery detection in the datasheet for details. 

    6.3.4 Battery Management


    NOTE: System-level factors may affect the accuracy of the low-battery detect circuit. The designer
    should consider battery type, discharge characteristics, and a test load during battery voltage
    measurements.


    The Hibernation module can be independently powered by a battery or an auxiliary power source using
    the VBAT pin. The module can monitor the voltage level of the battery and detect when the voltage drops
    below VLOWBAT. The voltage threshold can be between 1.9 V and 2.5 V and is configured using the
    VBATSEL field in the HIBCTL register. The module can also be configured so that it does not go into
    Hibernate mode if the battery voltage drops below this threshold. In addition, battery voltage is monitored
    while in hibernation, and the microcontroller can be configured to wake from hibernation if the battery
    voltage goes below the threshold using the BATWKEN bit in the HIBCTL register.


    The Hibernation module is designed to detect a low-battery condition and set the LOWBAT bit of the
    Hibernation Raw Interrupt Status (HIBRIS) register when this occurs. If the VABORT bit in the HIBCTL
    register is also set, then the module is prevented from entering Hibernate mode when a low-battery is
    detected. The module can also be configured to generate an interrupt for the low-battery condition (see
    Section 6.3.13).

  • TRM (SLAU723A) Sec 6.4.1 [final sentence] suggests that CLK32EN be checked to see if the HIB/RTC is already running, which it wouldn't be after a "cold POR".

    Alternatively, you might try writing something (anything) to HIBCAL0/1 and using its VALID flag to detect a cold POR. I haven't tried this with our MSP432E, but I recently had to do something analogous (write to calendar even though I wasn't interested in it) for an RTC from [Other Guys].

  • Thank you for the answer. It helped on the one hand. On the other hand, we need to do the check if we have lost the RTC after the power is on again and not in the case when power is going off. We have small capacitors which could power the HIB module and RTC but we do not know for how long. This is why we want to make the check after the board is powered again. 

  • TRM (SLAU723A) Sec 6.4.1 [final sentence] suggests that CLK32EN be checked to see if the HIB/RTC is already running, which it wouldn't be after a "cold POR".

    This could work as a solution for us. Thank you.