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
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:
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:
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:
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
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?
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
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.
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.