This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to save context and registers using c programming ?

Hi,

Would like to understand how to save context and registers before entering STOP mode for 8051, and doing a reset, would restore all contexts and registers values ?

I can't find any examples or questions in the forum related to this. Hope someone can help.

Thanks

  • Hi,
    Usualy you should not place variables into registers - it is the RAM which designed for this purpose.
    During reset (and possible interrupt(s) which wake up a MCU), RAM contents is not modified; oh well, startup code may clear memory so look and modify C-startup code to delete this feature. Now, read some about PowerOn Flag and utilize it.
    BTW, do search on forum - it was already discussed...