Hello Everyone
I'm using a 5K potentiometer connected to an AD converter on my 16F877 to generate a number. The reason I used a pot was, so that I wouldn't have to save the value to the eeprom and take a chance that the value of that variable would become corrupted if I had a power failure during a write to the eeprom.
Now I'd like to learn the proper way of doing this but don't know where to begin.
I'd like to use pushbuttons instead of the pot to increase and decrease the value of the variable but I'm not sure on how or what I need to accomplish the task of detecting the power failure to be able to safely save the value of that variable before the power is lost.
I won't have any problems with the code routines for the pushbuttons to increase and decrease the variable and I know how to save the word variable to the onboard eeprom.
What I need to know is if I need a special chip of some sort to detect the power failure and will the onboard eeprom be adequate for saving the value? Could someone explain my options and suggest what would be the best way of accomplishing this. I'm totally in the dark on this one and would appreciate any feedback.
Thanks
Jessey
Bookmarks