LPC11C24FBD48 PIO1_4 issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC11C24FBD48 PIO1_4 issue

1,242 Views
Richard1964
Contributor I

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. 

0 Kudos
Reply
2 Replies

1,230 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

 

xiangjun_rong_0-1632618577088.png

 

0 Kudos
Reply

1,238 Views
Richard1964
Contributor I

Hi,

Found the problem, the pin was not set in IOCON to be digital.

Thanks,

Richard.

0 Kudos
Reply