LPC11C24FBD48 PIO1_4 issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC11C24FBD48 PIO1_4 issue

1,214 次查看
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 项奖励
回复
2 回复数

1,202 次查看
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 项奖励
回复

1,210 次查看
Richard1964
Contributor I

Hi,

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

Thanks,

Richard.

0 项奖励
回复