This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Differentiating between brown-out vs initial power-up

Hi,

I am using the nrf51822 in an intermittent high-current application where if the battery is close to dead, will sometimes cause the chip to reset because the voltage is dropping below ~1.7V. The battery recovers and the chip starts running again.

Is it possible to determine whether a reset is caused by low voltage versus a complete battery change? I believe that RESETREAS will equal 0 in either case.

Any easy way to do this?

Thanks.

  • While nobody comment on it offering on-chip solution which I think doesn't exist, although I may be wrong, I would offer solution with external components. Simple voltage monitor with reference voltage 0-1.7V, lets say 1.2V and timed output with the timer longer than nRF chip internal reset. I think few hundred ms will be enough, need to double check. Then connect output to GPIO. With output active low if nRF on startup recognize zero that means battery was removed, if 1 then was voltage drop considering lowest battery drop not lower than 1.2V

  • Hi Chris

    I think you are correct, you can not know internally in the chip if the reset was caused by brownout reset or power on reset, RESETREAS register is reset in both cases.

    The mechanism we provide to avoid reset on high current consumption and low battery is simply to shut down the chip gracefully before the battery gets too weak. This can be obtained by monitoring the battery voltage with the internal ADC or by getting a low voltage warning from the Power-fail comparator, which has a configurable warning level from 2.1V to 2.7V. Shutting down the chip before reaching brown out reset will also prevent potential Flash corruption, which might occur if the chip is in the middle of flash write/erase operation when entering brown-out reset.

Related