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

Define a XDATA byte that won't clear on reset

Guys - I am new to this micro and this tool set, and I need some help. I need to set a flag and then perform a CPU software reset (due to another problem). But I need to have a byte that survives the software reset and does not get cleared. If I define an XDATA byte, the STARTUP code will (I think) zap it before I can see it.

How can I write an XDATA byte (or any other byte for that matter) that will survive a software reset (not a power down, just a reset)?

Can anyone help?

Thanks in advance!

Chris

Parents
  • Yes you can declare a variable at an address look up @ in the manual.
    You can get a pointer an point at anything you want.

    I would allow startup to clear all the RAM except you byte. Put it at the end of RAM for convenience. Not clearing the RAM may give you random problems, if things expect the RAM to be cleared. Does you chip have a reset reason indicator? If so you may want to use that i the clear / do not clear decision.

Reply
  • Yes you can declare a variable at an address look up @ in the manual.
    You can get a pointer an point at anything you want.

    I would allow startup to clear all the RAM except you byte. Put it at the end of RAM for convenience. Not clearing the RAM may give you random problems, if things expect the RAM to be cleared. Does you chip have a reset reason indicator? If so you may want to use that i the clear / do not clear decision.

Children