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

Xdata initialization

Hi,
I want to know the way to initialize the Xdata memory from main() routine. Xdata starts from 0x0000 to 0x0800. Generally this will be taken care by startup routine (startup.a51). But i modified this file, so that it wont initialize Xdata. This is because in case of WatchDog reset, i have to store some important data to NVRAM by checking the integrity of XRAM data at the starting of main(). In case of watchdog reset my data will be available in XRAM. I have a way to differentiate the reset condition (Watchdog reset or reset due to power loss). So if it is watchdog reset, then first i will store important data from XRAM to NVRAM, then i want to clear out entire XRAM from 0x0000 to 0x0800. If any one can guide me to do this in assembly or C, then it could be more helpful for me.

waiting for response.

Thanks in advance

Shail