MCF51QE128 flash write-erase

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

MCF51QE128 flash write-erase

821 Views
jluis
Contributor I

Hi,

 

I need help about how to write and erase segments of the flash memory. I wrote code as the flow chart that appears on page 84 of reference manual, but it doesn´t works.

When run the code resets the microcontroller, and de SRS indicates a illegal opcode and a Illegal address SRS = (0x18). The segment that I want to program  and erase is the last one (0x1FC00 - 0x1FFFF).

 

Have anybdy some comment? Are there something I'm missing?

Labels (1)
0 Kudos
1 Reply

225 Views
RichTestardi
Senior Contributor II

You can see my code that works on the MCF51QE128 (as well as about a dozen different MCUs) in the skeleton.zip archive at the bottom of this page:

 

http://www.cpustick.com/downloads.htm

 

Just look in sources/flash.c and follow the MCF51QE128 #ifdef.  I'm happy to answer any questions you might have about how it works.  The routines you want are flash_erase_pages() and flash_write_words().

 

-- Rich

0 Kudos