This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

High Fequency UART transmissions

I am using the nrf52832 with its Development kit to transmit trough UART to the PC a frame with 26 bytes, I have configured the port to 1MBoudRate. Once I prepare the frame I use the next instructions to transmit:

while(nrf_drv_uart_tx_in_progress()){}; nrf_drv_uart_tx(finalframe ,26);

The intention is to transmit a new frame every 250uS which implies a frequency of 4kHz. In theory if I have settled the speed to 1MboudRate this should be possible, however, the frames are not received right, 1 of every 8 frames has a byte missing. It starts to send all bits properly when the frequency decreases to 2,5kHz.

Any idea why this could be happening? Maybe can I use another transmit function to tx using UART?

Parents
  • RTS - Ready To Send - is an output on the nRF. This pin is set high when the nRF is unable to receive more bytes.

    CTS - Clear To Send - is an input on the nRF. It will be controlled by the other device (the virtual COM port on your PC in your case). If this is set high and the UART is set up to use flow control, the nRF will stop sending data.

    If the flow control is working correctly you should not see any data on the TX line while CTS is high.

    It sounds to me like the FIFO (app_uart_fifo) is not working correctly if it is no difference in the buffer size you set. I assume you are talking about the TX_BUF_SIZE used in APP_UART_FIFO_INIT(..). Do you get any APP_UART_FIFO_ERROR event in the uart event/error handler?

Reply
  • RTS - Ready To Send - is an output on the nRF. This pin is set high when the nRF is unable to receive more bytes.

    CTS - Clear To Send - is an input on the nRF. It will be controlled by the other device (the virtual COM port on your PC in your case). If this is set high and the UART is set up to use flow control, the nRF will stop sending data.

    If the flow control is working correctly you should not see any data on the TX line while CTS is high.

    It sounds to me like the FIFO (app_uart_fifo) is not working correctly if it is no difference in the buffer size you set. I assume you are talking about the TX_BUF_SIZE used in APP_UART_FIFO_INIT(..). Do you get any APP_UART_FIFO_ERROR event in the uart event/error handler?

Children
No Data
Related