I have a switch that increments a variable each time it is pressed....let's just call the variable 'temp' for ease here.
What I'd like to happen is that when the switch is held down for say 1 second, that the PIC either powers off or goes to sleep (gotta look into options for this bit).
Where I'm heading here is that I'd like the PIC to store away the content of the aformentioned variable 'temp' & then restore it upon power up (or coming out of sleep)
I've not a clue how to approach this!
What should I be searching for...is there a good thread/primer that cover the steps needed to write a PIC variable into non-volatile memory & read it when the pic powers up (or comes out of sleep....
(incidentally, are program variables remembered while a PIC sleeps?)
Many thanks!
Bookmarks