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.

HIB RTC in "Arbitrary Power Removal" mode

Hi

I am working on a platform based on a TIVA TM4C1233D5PMI. In the application I need the MCU to keep the time (RTC) when the main power (VCC) is "arbitrarily" removed. Basically I just want the RTC to keep running on the battery when power is removed, such that the time can be used when the power comes back.

According to the TIVA datasheet (and this forum) this seems to be very easy to accomplish using the TIVA hibernation module, the RTC and an external battery.

I have created the below schematic for the hibernation module (basically directly from the datasheet):

I have some questions, for which I have not been able to find clear answers (not clear to me atleast):

  1. When using the RTC in this "Arbitrary Power Removal" mode (as described in the datasheet), how should I connect the wake pin?
  2. Is it correct that the RTC can be configured to keep running independent of the main power using the above circuit?
  3. Is it correct that the MCU will boot normally (POR) whenever the main power is connected, using the above circuit? And that the RTC will be available when it has booted?

I really appreciate any help that you can provide.

Thanks.

Best regards 

Christian

  • Hello Christian

    The connection of WAKE pin must always be to a Pull Up for normal operation. In Arbitrary power removal it will not work anyways as there is no normal power shut down

    If the VBAT is supplied separately, then the main VDD supply will not cause an issue if either the PINWEN is enabled or RTC is enabled

    The VBAT does not have any play in power up. So on reconnecting VDD supply the RTC will continue to run as is.

    Regards
    Amit
  • Hi Amit

    Thanks alot for the prompt reply!

    Would you recommend connecting WAKE to VDD or VBAT (with pull up resistor)?

    Thanks

    Best regards
    Christian
  • Hello Christian,

    Does WAKE pin have a use in your application?

    Regards
    Amit
  • Hi Amit

    No it should not be used. However, the datesheet recommends that it is not left unconnected.

    So the question is: should I pull up to VDD (which is sometimes removed) or to VBAT?

    Thanks

    Christian
  • Hello Christian,

    The WAKE pin must be connected to VBAT via a 1Mohm pull up to limit current drain on the battery

    Regards
    Amit
  • Hi Amit

    Thanks alot for your time and help, much appreciated!

    Best regards
    Christian
  • Hello Christian,

    You are welcome. Do let us know if you run into any other questions.

    Regards
    Amit
  • Hi again

    I have one follow-up question to this thread. I hope it is okay that I post it here (even though it has been marked as answered).

    I would like to be able to detect if the PCB has been populated with the hibernation module crystal and the hibernation module battery (assuming that they are always added together).

    I have been investigating several solutions. Here comes the two I find most reasonable:

    1. In software, enable the RTC and check if it works. if the RTC counter registers are counting, then assume that he RTC crystal is available. If they are not counting, assume that the hibernation module circuitry has not been added.

    2. Measure the battery voltage using an additional input pin. If a voltage is detected, assume that the hibernation module circuitry has been added.

    In 1. I am not sure that it will be possible to detect this in software - what happens if the hibernation module is enabled without and crystal? Will the MCU crash and reboot or will it gracefully return an “error”.

    In 2. I am worried that the I/O pin used for detection of the battery will consume too much current - in the datasheet the leakage current of an input gpio is given to 1uA, which is in the same range as the hibernation module itself. Also, how much will this connection affect the battery when the main MCU is off.

    Please note that I do not need to detect the presents of both the battery and the crystal, I assume that they are always both added or not added to the PCB.

    I hope that it is clean and appreciate any help that you can provide.

    Best regards

    Christian

  • Hello Christian

    If the crystal is not mounted then there can be 2 conditions

    1. When the Hibernate Config function is called it gets stuck due to lack of a clock
    2. If there are some spurious noise pulses that cause it to exit the while loop, then a RTC mechanism as mentioned should help. But then a spurious pulse will cause RTC to move ahead but very unpredictably.

    The MCU will not crash when there is no 32K crystal

    As for battery detection, you may want to check the low battery mechanism to see if the Hibernate module can detect a NO battery condition.

    Regards
    Amit