RT595 using J27 J28 Arduino header uart RTS wave form issue

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

RT595 using J27 J28 Arduino header uart RTS wave form issue

3,446 次查看
siminFeng
Contributor I

I'm using RT595 board Arduino header J27[1][2] J28[3][4]  flexcomm12 as uart port to transfer data.

config FC12_TXD_SCL_MISO/FC12_RXD_SDA_MOSI/FC12_CTS_SDA_SSELN0/FC12_RTS_SCL_SSELN1 with IDE pin config tools and using USART_TransferStartRingBuffer

USART_TransferReceiveNonBlocking interface to receive data.

But I found RTS pin wave form is abnormal when receiving data.when zhere is data in RX pin.RTS pin will pull up each time, please help check where keeps control pulling this pin high?

for better understanding you can refers to attachment

0 项奖励
回复
6 回复数

3,332 次查看
siminFeng
Contributor I

My init code:

USART_GetDefaultConfig(&config);
config.baudRate_Bps = 115200;
config.enableTx = true;
config.enableRx = true;
config.enableHardwareFlowControl = true;

USART_Init(USART_MASTER, &config, USART_MASTER_CLK_FREQ);

/* Create UART handle. */
USART_TransferCreateHandle(USART_MASTER, &pUart->uartHandle, USART_UserCallback, pPal);
USART_TransferStartRingBuffer(USART_MASTER, &pUart->uartHandle, pUart->rxRingBuf, USART_CIRC_BUFF_SIZE);

 

pUart->sendXfer.data = pUart->tx_buf;
pUart->sendXfer.dataSize = sizeof(pUart->tx_buf);
pUart->receiveXfer.data = pUart->rx_buf;
pUart->receiveXfer.dataSize = PERODIC_HEAD_LEN;

pUart->rxOnGoing = true;
USART_TransferReceiveNonBlocking(USART_MASTER, &pUart->uartHandle, &pUart->receiveXfer, &bytesToReceive);

 

 

My receive code:

            size_t rbLen = USART_TransferGetRxRingBufferLength(&pUart->uartHandle);
 
            if(rbLen > 0){
                pUart->receiveXfer.dataSize = rbLen;
                USART_TransferReceiveNonBlocking(USART_MASTER, &pUart->uartHandle, &pUart->receiveXfer, &bytesToReceive);
                if(bytesToReceive == rbLen){
                    circRxBuff.write(pUart->receiveXfer.data, pUart->receiveXfer.dataSize);
                }
            }
}
0 项奖励
回复

3,277 次查看
Habib_MS
NXP Employee
NXP Employee

Hello again @siminFeng,

I tested the functionality for flow control modifying the SDK example called "usart_interrupt_rb_transfer" using two RT59-EVK using the same pins 27[1][2] J28[3][4]. Flow control is working correctly:

Habib_MS_0-1724263350672.png

In the last data frame, the RTS pin is put in high when the RX is receiving data, after the stop bit the RTS is put in low and so on in all data frame as mentioned in chapter 53.3.2.2.1 called "Hardware flow control" in the RM.

 

You can see the code attached below that use one board of transmitter and the other board of receiver; the different use can be set changing the next define:

Habib_MS_1-1724263350672.png

I highly recommend see the pin configurations and the peripheral configurations, where both are configurated in Config tools.

Please let me know if you have questions about the code.

BR

Habib

 

 

0 项奖励
回复

3,205 次查看
siminFeng
Contributor I

Hi Habib:

Thanks for your help.

I can not find "chapter 53.3.2.2.1 called "Hardware flow control" in the RM." this document.

can you help provide the download link?

0 项奖励
回复

3,191 次查看
Habib_MS
NXP Employee
NXP Employee

Hello again @siminFeng,

This document refers the Reference Manual (RM) and you can find this document in this page where is called "i.MX RT500 Low-Power Crossover MCU Reference Manual"

BR
Habib

0 项奖励
回复

3,349 次查看
Habib_MS
NXP Employee
NXP Employee

Hello again @siminFeng ,

In order to support you better, Can you please share with me your code. This with the propose of  replicating better your issue.

BR

Habib.

0 项奖励
回复

3,376 次查看
Habib_MS
NXP Employee
NXP Employee

Hello @siminFeng,
Sorry for taking a while to response you. I am still working in order to replicate your issue in my RT595-EVK.

On the other hand, you can consult more information about the functionality and caracteristics  of RTS and CTS in the chapter 53.3.2.2.1 called "Hardware flow control" in the RM, 

I will get back to you with more details about the case as soon as posible. 
BR
Habib.

0 项奖励
回复