LPC546xx: pin used as a capture for CTIMER and GPIO input

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

LPC546xx: pin used as a capture for CTIMER and GPIO input

678 次查看
giusloq
Contributor III

I want to use a pin as a CTIMER capture input for both edges. When the ISR is fired, I want to read the digital input level to understand if the trigger that fired the ISR has been for rising or following edge.

However I don't know if it is possible, because it seems GPIO functionalities are disabled when the pin is configured as a "special function" (in my case, timer capture).

Moreover I can't deduce the edge that caused the trigger, because the interrupt flag isn't splitted between rising and falling, there's only one flag per input capture.

0 项奖励
回复
1 回复

675 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Giuseppe,

Even if you configure the pin as peripheral function instead of GPIO, generally, you can read the GPIO port pin register to get the current logic of the pin. For example, you configure the FUNC bit as 4 in IOCON register of P2_17, you can read the GPIO2 port pin register to get the logic of P2_17.

For detailed inf, pls refer to section 13.5.5 GPIO port pin registers in UM10912.pdf

Hope it can help you

BR

XiangJun Rong

 

0 项奖励
回复