hello; can u explain me about power fail recovery in microcontroller. i m using c8051f020 controller,in that RSTSRC register is present, its 7th bit is set when power fails. but how to write the code after that, means suppose if my test is going on, and power fails, then depending upon RSTSRC.7 bit how to get back to test. on reset microcontroller starts from 0000h, then how to store the status before power fail can u provide me sample code, i m using 'c' language thank u all.
1) I am responsing even though you specifically ask 'micro' (u) to explain 2) read it all, some RSTSRC bits are only valid under some conditions 3) If power fail recovery is a concern, you will have to store things - what depends on the app - in permaknent memory, you can use the ships internal flash, I would use an external flash/fram/eeprom memory (serial or parallel) to avolid the risk of code corruption. 4) can u provide me sample code i do not know if 'micro' can, but a) who would be able to gaze in a crystal ball and see what your app needs and b) 'sample code' is the bane of all when used before you have tried it yourself.
Erik