How to read the value on a pin when it is already configured as UART RX

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

How to read the value on a pin when it is already configured as UART RX

跳至解决方案
1,887 次查看
Lukaz
Contributor III

Hello,
in the i.MXRT 106x MCUs, if I configure a pin as the receiver pin for a UART module, how can I read the value of that pin (HIGH or LOW) at any time through the GPIO module (or any other way)? 
I thought if I enabled the SION mode in the mux_ctrl_pad register, it would be possible but it doesn't seem to be working. Any idea what can I do?

Thanks

标签 (1)
0 项奖励
回复
1 解答
1,822 次查看
diego_charles
NXP TechSupport
NXP TechSupport

Hi @Lukaz 

Currently, I do not know another alternative rather than the one below.

UART by itself provide Idle Line detection as mechanism, that actually waits for a full character receive time to detect when a character was send. See this post. https://community.nxp.com/t5/i-MX-RT/lpuart-idle-line-detection-takes-up-to-2-3ms/m-p/1360390 However it seems that you got some time constraints, correct?

Diego

 

在原帖中查看解决方案

6 回复数
1,881 次查看
Daniel15
Contributor I

I'm experiencing similar behavior right now. I'm using an i.MXRT 1176. I'm attempting to configure a pin mux for the XBAR function, but also read the value through GPIO. I've set the SION bit but can't seem to read the value through GPIO. I can read the value just fine if I configure the mux for the GPIO function so I know I don't have anything else misconfigured.

The reference manual states "Force the selected mux mode Input path no matter of MUX_MODE functionality." That would seem to imply the input path is only enabled for the module selected in the mux mode. I'm starting to believe it.

0 项奖励
回复
1,845 次查看
diego_charles
NXP TechSupport
NXP TechSupport

Hi all, 

Regarding this comment,  that would seem to imply the input path is only enabled for the module selected in the mux mode. I'm starting to believe it.

I agree with this, see the description from this AN

diego_charles_0-1660104514296.png

Just looking for an alternative for you @Lukaz  What are you trying to achieve by reading  the level of the GPIO? Are you trying to generate an event whenever the value on the RX line changes?

Best regards, 

Diego

0 项奖励
回复
1,829 次查看
Daniel15
Contributor I

In my case I'm trying to get some clues about a potential component failure. The primary function of the pin is to serve as a capture port and extract the frequency of the signal (using QTMR for this). However, if the external component fails (no transitions of the signal observed) it would be nice to know whether the signal is constant high or low. I can always reconfigure the pin for GPIO if I detect a failure, but I thought it would be cleaner if I could just always monitor the signal through GPIO and still allow normal function with the QTMR.

0 项奖励
回复
1,840 次查看
Lukaz
Contributor III

Hello Diego,

Thanks for your reply
yes, I am working with some protocol that sends some synch bits, and since it is not a complete byte I can't read it after receiving is complete using the Rx Data Register Full flag, therefore I was trying to read the pin through the GPIO module, which wasn't a success.

 

0 项奖励
回复
1,823 次查看
diego_charles
NXP TechSupport
NXP TechSupport

Hi @Lukaz 

Currently, I do not know another alternative rather than the one below.

UART by itself provide Idle Line detection as mechanism, that actually waits for a full character receive time to detect when a character was send. See this post. https://community.nxp.com/t5/i-MX-RT/lpuart-idle-line-detection-takes-up-to-2-3ms/m-p/1360390 However it seems that you got some time constraints, correct?

Diego

 

1,868 次查看
Lukaz
Contributor III

Hi Daniel,
I actually believe so too, especially because the following is written in the manual as one of the reasons the SION mode would be useful: "Module x drives the pad and also receives pad value as an input".

So I imagine that the input path that is forced by setting the SION bit is only to the module selected depending on the mux configuration. I hope there is a way to do the reading of the pin somehow.

0 项奖励
回复