UART RX timing with external device

Hello, 

I wanted to reach out about the issue I've been running into regarding the UART Async API. I am having trouble narrowing down what the cause could be. 

I am using an nRF9161 DK and the v2.9 SDK. The communication below is using UART2.

Right now I have the 9161 connected to an external device (pin pad / card reader). I can successfully send data over the TX line and receive data over the RX line, but there are times when when no data comes back over the RX line. Specifically when a card is presented rather than a key pressed. 

TX timeout - SYS_FOREVER_MS

RX timeout - 16000 micro seconds (I have tried ranges from 2000 to 16000)

The sequence of events is as follows:

A button on the pin pad is pressed.

The 9161 is triggered via an interrupt pin.

An ISR puts a operation into the work queue. 

UART ASYNC API is called to enable TX pin (uart_tx).

UART_TX_DONE enables the RX buffer (uart_rx_enable).  
_________ (only works part of the time)__________
UART_RX_RDY submits a message queue to process the data.
I seem to have a timing error with receiving data. Again, this works pretty consistently with the pin, but never with the card. I was hoping you could provide a little detail with how the UART_ASYNC_API handles RX data (delays and timeouts). I have a feeling the RX pin is getting enabled too late as pressing a button has a longer "action window" than presenting a card. 
Please let me know if you need more detail, 
Thank you, 
Jack


Related