IMXRT1024 UART Hardware Control Parameters (in Code and Reference Manual)

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

IMXRT1024 UART Hardware Control Parameters (in Code and Reference Manual)

Jump to solution
1,298 Views
Lukas_Frank
Senior Contributor I

Hi all, 

I am a little bit confuse about the hardware control flow. In the code side LPUART configuration struct has only RxRTSEnable and TxCTSEnable parameters. However, in the 44.6.1.11 section of reference manual, RXRTSE, TXCTSE and also TXRTSE exists separately. I have following three issues:

 

First : Is RXRTSEnable parameter in code same with RXRTSE?

Second : What is the equavelant of TXRTSE Flag(44.6.1.11 in RM) in code?

Third : I am just trying to see RTS bit is asserted on Ossiloscope while datatransmission. But when I enable RXRTSEnable=true and TXCTSEnable=true my code does not goes into to UART_WriteByte if case. When I set RXRTSEnable=true and TXCTSEnable=false my code goes into the if case successfully.

if(checking whether TxFiFoEmpty)
{
UART_WriteByte(...)
}

Thanks and Regards.

0 Kudos
1 Solution
1,237 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Lukas_Frank 

  Please check this application note, which maybe useful to you:

https://www.nxp.com/docs/en/application-note/AN12679.pdf

It use the RTS control the 485, and you can see, in the Figure15, the RTS is controlled automatically.

So, if you test it, you also can share some wave to me, then I can help you to check the details.

best Regards,

Kerry

View solution in original post

0 Kudos
7 Replies
1,290 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Lukas_Frank 

 Answer your questions:

First : Is RXRTSEnable parameter in code same with RXRTSE?

Answer: yes, it is . enableRxRTS configure RXRTSE

if (true == config->enableRxRTS)
{
/* Enable the receiver RTS(request-to-send) function. */
base->MODIR |= LPUART_MODIR_RXRTSE_MASK;
}
if (true == config->enableTxCTS)
{
/* Enable the CTS(clear-to-send) function. */
base->MODIR |= LPUART_MODIR_TXCTSE_MASK;
}

Second : What is the equavelant of TXRTSE Flag(44.6.1.11 in RM) in code?

Answer: Driver didn't add it, you can add it in the stucture, or you can use the register to control it directly.

Third : I am just trying to see RTS bit is asserted on Ossiloscope while datatransmission. But when I enable RXRTSEnable=true and TXCTSEnable=true my code does not goes into to UART_WriteByte if case. When I set RXRTSEnable=true and TXCTSEnable=false my code goes into the if case successfully.

Answer:  Which code you are refering? SDK lpuart_harware_flo_control project, I didn't find your mentioned RXRTSEnable TXCTSEnable, just enableRxRTS and enableTxCTS

 

Best Regards,

Kerry

0 Kudos
1,283 Views
Lukas_Frank
Senior Contributor I

Hi @kerryzhou

 

Q1:What does TXRTSE exactly it is not really clear on RM?

 

Q2(Third of last post):I just mentioned about them conceptually. You are right they are configUART.enableRxRTS and configUART.enableTxRTS. I am just trying to see RTS bit is asserted on one probe of Ossiloscope while seeing data transmission signals on other probe. When I just enable RxRTS and disable TxCTS data tranmission is failed. Why two of them must be enabled? I wonder about that because in the example of SDK Uart Interrupt data transmits successfully even if I do not enable RxRTS or TxCTS.

Q3:Why should I enable both RxRTS and TxCTS for the successful transmission on hardware flow control? Couldn’t I do data transmission from UART Module to the outer environment by disabling TxCTS?

 

Q4:What should I do successfully transmit my data and observe RxRTS signal on one probe and observe my data bits like 10101010 on other probe ?

 

Q5:When I try SDKs hardware flow control example, my datas seen different from sended by buffer? I only just edit code by changing transferTxData array by filling it 101010101010….101010 (size 256).

Thanks and Regards.

0 Kudos
1,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Lukas_Frank ,

   Answer your questions:

Q1:What does TXRTSE exactly it is not really clear on RM?

Answer:  RM mentioned it in the register:

Transmitter request-to-send enable Controls RTS before and after a transmission. This bit should be changed only when the transmitter is disabled.

1b - When a character is placed into an empty transmit shift register, RTS asserts one bit time
before the start bit is transmitted. RTS deasserts one bit time after all characters in the transmitter
FIFO and shift register are completely sent, including the last stop bit.

Q2(Third of last post):I just mentioned about them conceptually. You are right they are configUART.enableRxRTS and configUART.enableTxRTS. I am just trying to see RTS bit is asserted on one probe of Ossiloscope while seeing data transmission signals on other probe. When I just enable RxRTS and disable TxCTS data tranmission is failed. Why two of them must be enabled? I wonder about that because in the example of SDK Uart Interrupt data transmits successfully even if I do not enable RxRTS or TxCTS.
Answer:  Do you check the RTS, CTS wave when it is not enabled? You also can debug the code, check the related register, whether it is enabled.  If the register is not enabled, the related pin should not be controlled automatically.

 

 

Q3:Why should I enable both RxRTS and TxCTS for the successful transmission on hardware flow control? Couldn’t I do data transmission from UART Module to the outer environment by disabling TxCTS?

Answer: It determine your usage, whether your external side also need the RTS and CTS? I don't think you need to enable both is the must. This is from the RM:

The transmitter's CTS_B signal can be enabled even if the same LPUART receiver's
RTS_B signal is disabled.

Q4:What should I do successfully transmit my data and observe RxRTS signal on one probe and observe my data bits like 10101010 on other probe ?

Answer: Do you want to use it for the external 485? YOu can refer to this one:

kerryzhou_0-1628581366502.png

 

Q5:When I try SDKs hardware flow control example, my datas seen different from sended by buffer? I only just edit code by changing transferTxData array by filling it 101010101010….101010 (size 256).
Answer:  data should be the same as the UART, just need to check the RTS, CTS pin.

 

0 Kudos
1,244 Views
Lukas_Frank
Senior Contributor I

Hi @kerryzhou,

 

Q1(+): I read it in RM but it is not like the other UARTs. It is a sophisticated one. Thanks.

Q2: What do you exactly mean with "the related pin should not be controlled automatically" ? Will be the pin high signal to the oscilloscope when I debug the code and config.enableRxRTS=true line is run and pass next step?

Q3: Data communication is failing when I use my UART Example that created from scratch(by the way I am working on two example. One of them is my own example and another one is SDK Default hardware control example. And, I am trying to understand what is going on). Simply, it uses UART_WriteByte method in infinite while loop and writing "0x10" byte to the TX pin succesfully. Also, I am observing data flow in oscilloscope successfully. When I set config.enableRxRTS = true and config.enableTxCTS = true, datas is not successfully observing 11110000 form in oscilloscope, it is always staying high form. But when I set config.enableRxRTS = true and config.enableTxCTS = false, datas is successfully observing as 11110000 form in oscilloscope. Why config.enableTxCTS = true effects like that? Will I am not able to use TxCTS in my board?

Q4(+): I am just trying to do that on my board. No like in the section 44.3.4.4. Thanks.

Q5: Nooo, absolutely not. RTS pin is asserting as high form one bit before the data bit transmission start. I am writing 1010101....1010(size 256) to the TX pin in my code to observe better in oscilloscope. So I just changed the transferTxData array's content in default SDK example. But it is always staying high bit form (1). What is that mean?

 

Thanks and Regards.

0 Kudos
1,238 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Lukas_Frank 

  Please check this application note, which maybe useful to you:

https://www.nxp.com/docs/en/application-note/AN12679.pdf

It use the RTS control the 485, and you can see, in the Figure15, the RTS is controlled automatically.

So, if you test it, you also can share some wave to me, then I can help you to check the details.

best Regards,

Kerry

0 Kudos
1,241 Views
Lukas_Frank
Senior Contributor I

Hi Dear @kerryzhou ,

 

Q1(+): I read it in RM but it is not like the other UARTs. It is a sophisticated one. Thanks.

Q2: What do you exactly mean with "the related pin should not be controlled automatically" ? Will be the pin high signal to the oscilloscope when I debug the code and config.enableRxRTS=true line is run and pass next step?

Q3: Data communication is failing when I use my UART Example that created from scratch(by the way I am working on two example. One of them is my own example and another one is SDK Default hardware control example. And, I am trying to understand what is going on). Simply, it uses UART_WriteByte method in infinite while loop and writing "0x10" byte to the TX pin succesfully. Also, I am observing data flow in oscilloscope successfully. When I set config.enableRxRTS = true and config.enableTxCTS = true, datas is not successfully observing 11110000 form in oscilloscope, it is always staying high form. But, when I set config.enableRxRTS = true and config.enableTxCTS = false, data is successfully observing 11110000 form in oscilloscope. Why setting config.enableTxCTS = false effecting like this? Will I am not able to use TxCTS correctly in my board?

Q4(+): I am just trying to do that on my board. No like in the section 44.3.4.4. Thanks.

Q5: Nooo, absolutely not. RTS pin is asserting as high form one bit before the data bit transmission start. I am writing 1010101....1010(size 256) to the TX pin in my code to observe better in oscilloscope. So I just changed the transferTxData array's content in default SDK example. But it is always staying high bit form (1). What is that mean?

 

Thanks and Regards.

0 Kudos
1,241 Views
Lukas_Frank
Senior Contributor I

Hi @kerryzhou,

 

Q1(+): I read it in RM but it is not like the other UARTs. It is a sophisticated one. Thanks.

Q2: What do you exactly mean with "the related pin should not be controlled automatically" ? Will be the pin high signal to the oscilloscope when I debug the code and config.enableRxRTS=true line is run and pass next step?

Q3: Data communication is failing when I use my UART Example that created from scratch(by the way I am working on two example. One of them is my own example and another one is SDK Default hardware control example. And, I am trying to understand what is going on). Simply, it uses UART_WriteByte method in infinite while loop and writing "0x10" byte to the TX pin succesfully. Also, I am observing data flow in oscilloscope successfully. But, when I set config.enableRxRTS = true, datas is not successfully observing 11110000 form in oscilloscope, it is always staying high form.

Q4(+): I am just trying to do that on my board. No like in the section 44.3.4.4. Thanks.

Q5: Nooo, absolutely not. RTS pin is asserting as high form one bit before the data bit transmission start. I am writing 1010101....1010(size 256) to the TX pin in my code to observe better in oscilloscope. So I just changed the transferTxData array's content in default SDK example. But it is always staying high bit form (1). What is that mean?

 

Thanks and Regards.

0 Kudos