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?
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