1 Reply Latest reply on Aug 12, 2018 11:10 PM by jukrc_1086071

    Clean boot after low voltage supply


      I have a PSOC 4200 based battery-powered project that goes into deep-sleep and wakes up on external hardware interrupt on pin than goes back to sleep.


      Recently I wanted to add a battery monitoring circuit (LED that flashes when battery low) so I set up ADC input and a Global Signal the generates a Watchdog timeout to wake from deep-sleep, read ADC, blink LED and go back to sleep.


      What I have found is that this works ok and I get indication of low battery (I am using rechargeable 400mAHr lithium ion). However, if the circuit runs too long when battery low, the software "hangs" and only if I remove and reapply power does it run correctly again.


      Can I add a second Global Signal to generate a LVD detection on low power supply and have it generate an interrupt to set a flag. Then when I get condition that Flag is set but battery is OK, I can reboot the code and clear the flag?


      Would I just restart my init code or do a full hardware reset?