I have an external 16 bit SRAM connected to a 9S12XET256 and it is working fine in expanded mode. But I start out in (special) single chip mode and go to expanded mode by writing to the MODE register. Before I do that, while still in single chip mode, I want to test the SRAM lines for grounding, shorts, and opens. The problem I am finding is pin PORTE.5, which will be used as /RE or /OE in expanded mode. I am reading and seeing a ground on the pin, even though DDRE.5 is 0 and PUCR.PUPEE is 1. If I set DDRE.5 to 1, I can set or clear the line, so it isn't being grounded by something external. Any ideas?
The data sheet states in a little bit confusing way that por PE.5 and PE.6 contains pull-down (not pull-up):
“Enable pull-up devices on all Port E input pins except on pins 5 and 6 which have pull-down devices only enabled during reset.”
Clear sentence the ports do not contain pull-up is missing in the data sheet.
However, the alternative function of the pin during reset is to set MODE register of the MCU on the basis of value at pins MODC, MODB and MODA. Usually, the pin is connected via jumper and pull resistor to GND at the evaluation board. Single chip mode is selected by MODC=1, MODB=MODA=0. So it is god to check it.
Underline note: In all examples on our community pages I use start with single chip mode and change to expanded mode. The only thing which has to be done is that the switch of the mode must be done sooner than data initialization in the external RAM (if used). In the code warrior it is necessary to do that in the Startup function in the fila Start12.c