I suppose this could apply to a bunch of stuff, but this is specific to what I’m doing here. It might help someone else out though. I have a 328p that’s running a sketch that’s using two pins acting as DATA and CLK, driving a bunch of WS2801 LED drivers. The 328p as well as the LED strings are both powered via Vin. Now, when the battery voltage drops too low, the Atmel quits, or shuts off. However, because the LED string is powered separately, that will stay on (till the batteries go completely dead), and stuck on whatever the last command was.
Now, programmatically, I can send 0x0’s down the string and the LEDs will shut off - the string is still powered, but nothing is lit. Is there a way to do that when the Atmel shuts off? (In other words, does the Atmel, at any time, know when it’s about to die?)
Or should I be looking at an external solution (to the Atmel) that can detect when the Atmel goes ‘kerplunk’ and it kills power to the LED strings? Then there’s the issue of the batteries possibly regenerating just enough juice to restart the Atmel again … I wouldn’t want that to happen … once dead, it needs to stay dead till I replace the batteries.