MCF51JM64 EEPROM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF51JM64 EEPROM

564 Views
micky
Contributor I

Hello, I have a MCF51JM64 microcontroller and it seems that it doesn't have a eeprom memory, just 64 KB of Flash (for programms). It has a bootloader in it, and my program it is about 32 KB in size.

 

What i want is to record, in the Flash memory like on eeprom, some data to  keep  if the microcontroller is closed. I also use CodeWarrior v.6.

 

Please if someone knows a solution how to do it, I wait for an answer.

Thanks.

Labels (1)
0 Kudos
1 Reply

295 Views
TomE
Specialist II

Nice FLASH in that chip. It has 64 1k sectors.

 

So you have 32 separate sectors to play with.

 

If you just want to profram something a few times (less than 32 times in the lifetime of the product), then just program your data into the first few bytes of a sector, starting from the last spare one and going up until you run out.

 

If you just have (say) 32 bits of data, then you can store 32 sequential different versions of your data in each sector, and with 32 spare you can do this 32*32=1024 times before you have to worry about erasing anything. To find the last valid one you just scan through memory looking for the last one before getting the erased value.

 

You could allocate two sectors and write to one, fill it up, start on the second and erase the first and so on and so on. Simple coding, but hard to get right and hard to fully test.

 

For those simple approaches you can get more and more complicated up to the level of "EEPROM emulation applications" (mentined in the Reference Manual).

 

Type "eeprom emulation" into the "search" field on Freescale's main web page. There's lots of App Notes, seemingly for every family of chips EXCEPT the ColdFire! There are ones for the MPC5xxx, MC9S, 68HC, S12X etc. They may give you some clues if you can't find any for this chip.

 

Tom

 

0 Kudos