cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Contributor II

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?

Thanks

0 Likes
Reply
1 Solution
Anonymous
Not applicable

I think I would suggest you to use a comparator instead of the ADC. The comparator runs in deep-sleep and can throw an Interrupt while in deep-sleep, as far as I remember.

View solution in original post

0 Likes
Reply
1 Reply
Anonymous
Not applicable

I think I would suggest you to use a comparator instead of the ADC. The comparator runs in deep-sleep and can throw an Interrupt while in deep-sleep, as far as I remember.

View solution in original post

0 Likes
Reply