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

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

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

Jump to solution
1,687 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,622 Views
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

 

View solution in original post

6 Replies
1,681 Views
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 Kudos
Reply
1,645 Views
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 Kudos
Reply
1,629 Views
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 Kudos
Reply
1,640 Views
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 Kudos
Reply
1,623 Views
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,668 Views
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 Kudos
Reply