I have some problems in interfacing an external 512KiB RAM to an MC9S12XEP100.
The very first BDM programming attempt (first power on) of the device went quite well, but instead of stopping to a breakpoint when the firmware download to the microprocessor has finished, the HiWAVE programmer said me that the firmware was ALREADY RUNNING, and I could stop it, neither reset it.. No BDM command seemed to be accepted by the processor.
Anyway, when power cycled the device, the firmware was running (I have some LEDs that told me that).
Then, I tried to reprogramm the device, but this time, it has not been possible. At each command the BDM tried to send, the microprocessor reset (I saw that using again the LEDs, since when a pin is in HiZ, one of those LED is on).
I've already designed boards with the MC9S12X but the very new thing ni this, was the RAM. Thus, I tried to disable it pulling down the MODA pin, and everything was OK!
Now I'm able to programm and reprogram the processor as many times as I want, to put breakpoint, and so on, with the BDM..
If I return to the previous configuration, with MODA pulled up, nothing works, as described above.
Now, the system configuration I'm using is the following:
MODA: pulled up, 5V
MODB: pulled down
MODC: pulled up, 5V
For selecting the normal expanded mode.
The RAM is connected as the following:
RAM_ADDR0 => S12X_ADDR1
RAM_ADDR17 => S12X_ADDR18
RAM_UB => S12X_ADDR0_UDS
RAM_OE => S12X_RE
RAM_LB => S12X_LDS
RAM_WE => S12X_WE
RAM_CS => S12X_CS2
RAM_DATA0 => S12X_DATA0
RAM_DATA15 => S12X_DATA15
And the memory configuration:
// ENABLING CS2
MMCCTL0_CS2E0 = 0;
MMCCTL0_CS2E1 = 1;
MMCCTL1_ROMON = 1;
MMCCTL1_ROMHM = 0;
MMCCTL1_RAMHM = 0;
EBICTL0_HDBE = 1;
EBICTL0_ASIZ = 0x12; // just using 18 lines of the address bus, even if the others are left unconnected.
With the MMCCTL1 written once at the very beginning.
My target is to have a 512KiB using the CS2. Where am I wrong?
Thanks in advance,