HI,
I have a design with a LPC11C24FBD48/301 and I'm using pin40 PIO1_4 as an input I have configured the pin with the following code:-
/* ID1 PI01 pin 4*/
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_4, (IOCON_FUNC0 | IOCON_MODE_INACT));
Chip_GPIO_SetPinDIRInput(LPC_GPIO, 1, 4);
However when the pin is read it always returns 0 even though the external pin has 3.3V applied. I have tried two boards with the same result. I Know this pin is used for waking the device is there some other configuration I need to do?
Thanks,
Richard.
Hi,
Yes, you have to enable the gated clock of the peripheral by setting the corresponding bit in SYSAHBCLKCTRL before you write any register of the peripheral. pls refer to UM10398.pdf.
This is the code in SDK to enable gated clock of IOCON.
CLOCK_EnableClock(kCLOCK_Iocon);
Hope it can help you
BR
XiangJun Rong
Hi,
Found the problem, the pin was not set in IOCON to be digital.
Thanks,
Richard.