Adam Oldham

reading from ROM and ROMON/ROMHM

Discussion created by Adam Oldham on Jul 7, 2006
Latest reply on Jul 14, 2006 by Steve Melnikoff
I have a mc9s12gc32 and have a few questions about it...

Can you read from this internal EEPROM area like you are reading from RAM? Meaning, 0xc000-0xfeff is page 3f and 0x4000-0x7fff (or 0x8000-0xbfff) is page 3e depending on how it is configured. If 0xc000 contains a 0x88, should I be able to run a program and read the 0x88 from 0xc000 by doing a simple instruction or line of c like:

data = *((byte *)(0xc000));

Next, I have external devices that require me to set up the CPU with ROMON and ROMHM so that page 3e normally at 0x4000-0x7fff map to 0x8000-0xbfff. So I configured code warrior to put all of default_rom into page_3e in the prm. Should be straight forward. However, when I look at the debugger, there is no data listed for 0x8000-0xbfff just all 0x00. But 0x3e8000 does contain the ROM.

LAST, I've noticed that when I have two ROM spaces broken up into page 3e and 3f, I have all nonbanked stuff and entry in 3f, and I put other code into 3e, but if nothing from the 3f page ever calls code in 3e, the code in 3e doesn't seem to load into the EEPROM. Why is that?

Which could lead me to my whole problem, if I am expecting code to be in 0x8000, but it isn't code I've called before, will 3e not be mirrored into 0x8000?

======================================================
Basically, what I am trying to do is build a simple program to live in 0xc000 and with this another program gets built and copied into 3e. But the program that runs doesn't call any of the code in 3e, it simply copies all of 3e into an external EEPROM device. But if I can never get to the code that is supposedly in page 3e, then I can't reliably copy to external eeprom.

Any advice?

Outcomes