aurora

Flash memory

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

Could anyone show me by example how to save 1 byte data into flash memory and get it back to the variable? I create a variable POWEROFF, and I give 1 to this variable in the main routine. I need to save the content of POWEROFF to a (any)location in flash memory before the MCU is disconnected from power. Then I need to get this data back into this variable when MCU is connected to power again.

 

I tried to use those supporting routines in ROM, such as RDVRRNG, PRGRNGE and ERARNGE. So far I am getting no where. I hope someone can show me an example in assembly code.

 

INCLUDE 'derivative.inc'         ; MC68HC908QY4A

 

poweroff    ds  1

 

mainLoop:           

            lda  #$1

            sta  poweroff

            bra  mainLoop

 

Thanks all

Outcomes