Content originally posted in LPCWare by wellsk on Fri Mar 14 09:00:56 MST 2014
If the pin muxing is correct, you might need to also add the 'digitial pin' flag.
Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 21, IOCON_FUNC0 | IOCON_MODE_INACT | IOCON_DIGMODE_EN);
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 22, IOCON_FUNC3 | IOCON_MODE_INACT | IOCON_DIGMODE_EN);
Here is the info on bit 7 for p0_22:
7 ADMODE Analog mode. 1
0 Enable. Pin is configured as analog input.
1 Disable. Pin is configured as digital I/O.
Here is the info on bit 7 for p1_21:
9:7 - - Reserved. 0b001
Note: Chip_IOCON_PinMuxSet() sets the IOCON registers *exactly* with the values that you pass, so you'll need to handle to digital or reserved bits in the call.