Single Wire Mode LPUART

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

Single Wire Mode LPUART

1,250 Views
Hellspread41
Contributor II

Hi Everyone,

I'm currently using the single wire mode for the LPUART but i have some issues with it.

Hellspread41_0-1661947140690.png

here is my own API to change the direction of the communication and the next one where the issue is happening.

Hellspread41_1-1661947266087.png

the issue is that i can send a packet only once and then it stucks inside the SetListeningState function and i think it is because of the WHILE(TC != 1) line. The strange part is it only happens when i activate the RX pin (RE = 1). if RE = 0, my API is working perfectly and i can receive the data from my slave but of course i can't read because RX is disabled.

My pin config : TXpin has use internal pull up resistance and RXpin has standard config.

I've also try to put a blocking delay of 5ms before the while(TC != 1) inside the SetListening function and with that it works perfectly but i lose too much time.

I think the TC flag just take too much time to set when my RX is activated.

Is there a solution for it or did i forget to check something ?

Thx a lot for your answer

 

 

0 Kudos
Reply
5 Replies

1,214 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

First of all, sorry for the later reply.

I checked RT LPUART module is same with KL17 product.

I would recommend customer to refer below link about using 1 wire mode of LPUART.

https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-with-LPUART-single-wire-mode-on-KL17/m-p...

Wish it helps.

1,183 Views
Hellspread41
Contributor II
@Hui_Ma when i debugged i noticed that my RAF flag don't reset should it be the cause of the error ? how can i force to reset this flag ?
0 Kudos
Reply

1,180 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Sorry for the later reply.

The RAF bit is read only and would be auto clear when related condition happen.

Mike

0 Kudos
Reply

1,211 Views
Hellspread41
Contributor II
thx for your Answer @Hui_Ma, i've already read this post but this changed nothing to my issue. The problem occurs when my slave answer to my packet, i can send one packet and get a response from my slave and it stucks when i want to send a second one. I think the TC flag doesn't want to set anymore.
0 Kudos
Reply

1,222 Views
Hellspread41
Contributor II
It's seems that the TC flag don't set when my slave is answering me ?
0 Kudos
Reply