If absolutely necessary, try a comparator interrupt for the shutdown part, and write a variable to eeprom. On startup, read back eeprom at beginning of program to decide which sub to branch to. Is there enough time to write to eeprom? Does it work reliably?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
that is what i was looking for , the one I've seen must write to the eeprom because it comes back up from a long power off in the last mode it was in last, but how would i do that?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
how do I make it so a 12f629 will do one sub when the power is turned on, and do another sub if the power is turned off then back on again quickly?
Isn't that what reading a button does for you?
If absolutely necessary, try a comparator interrupt for the shutdown part, and write a variable to eeprom. On startup, read back eeprom at beginning of program to decide which sub to branch to. Is there enough time to write to eeprom? Does it work reliably?
that is what i was looking for , the one I've seen must write to the eeprom because it comes back up from a long power off in the last mode it was in last, but how would i do that?