Question on HCS12, Expanded Mode (How much trouble am I in?)

Discussion created by VincentV on Aug 3, 2006
Latest reply on Sep 6, 2006 by William Whyte
I've inherited a design that uses an HCS12 and I the designer's intent was to access external flash as if it was interneal.

The trouble comes in that I'm not sure that he put everything where it is "supposed" to be for this to work well (or, as well as it can).

With the mode register set to:


I would expect that I should have internal flash up to 0x8000.

Everything above 0x8000 should be external access, yes?

The trouble comes in that certain flash operations seem to be working, while reading fails at some points.

For example, I can fetch the device id and manufacturing id of the flash device, and if I do a chip erase, it seems to take as long as it should, no more, no less.

However, when I go to verify that the chip was erased, the verification will fail at some address. Instead of 0xFFFF I'll read something else (usually different each time).

Examining the memory space in the debugger, I found that the value it was reading that was not 0xFFFF was coming out of the MCU memory!

This is bad.

Any thoughts? (I would be more than happy to provide more info if needed)