aurora

memory

Discussion created by aurora on Aug 13, 2010
Latest reply on Aug 17, 2010 by bigmac

I am using a MC908QC8CDRE MCU. How do I save one byte data to the RAM and retrieve the data when the MCU is connected to power source again?

 

I wrote a program for turning (controlling) on/off three LEDs (RED, Green and Blue) from a push button switch. Only one LED will be on at a time. I have setup a global variable for tracking which LED is turned on. After the user turns on the LED, the MCU will be disconnected from power source. When the MCU is connected to power again, I need to have the MCU to turn on the LED was selected. In other words, I need the MCU to remember the selection when it is disconnected from power. I think I need to save the information to the RAM, and then get the information back to a global variable when MCU power is recovered. Can anyone provide me an example in assembly code format?

 

Thanks,

hliu

Outcomes