GPIO Port 1 (2132)
2005-07-19 by Dave
Hello,
Some weird things happen when using PORT 1.
Firstly, make sure the debug and trace functions are disabled.
regVal = PINSEL2;
regVal &= ~((1 << 2) | (1 << 3));
PINSEL2 = regVal;
Next, set the pins used as outputs to become outputs, and drive their
outputs high.
regVal = (1 << 31) | (1 << 26) | (1 << 24);
IODIR1 = regVal;
IOPIN1 = regVal;
Constantly read the pin values and display.
port1.26 is always flickering (i.e. on/off) when read.
the output does not change, it remains driven high, just the
readback from IOPIN1 shows this.
Further, a circuit to detect switch closures uses 8 bits of port 0 and
8 bits of port 1. The inputs to port 1 read as expected, but the
inputs to port 1 are always 'high'. Can this be explained?
Dave