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
  • Ok some updates:

    • I enabled flow Control and it works better, however, using the oscilloscope I see that I have a CTS signal that indicates a suspension of my UART transmission, I observe this on the data that I am receiving, some frames (around 256 bytes) are not received.
    • I am using the UART driver module and initiating the UART with the function APP_UART_FIFO_INIT(...) so I assume that I am enabling the fifo OK. However, one curious thing is that I do not see any important effect when I change the size of the buffer from 1 to 1024 or vice-versa. I think that the error is related with the FIFO itself. However, I don't know if the CTS signal is settled by the uC itself or by the PC that is receiving the data through UART. Does anyone have an idea of what I am missing?
Reply
  • Ok some updates:

    • I enabled flow Control and it works better, however, using the oscilloscope I see that I have a CTS signal that indicates a suspension of my UART transmission, I observe this on the data that I am receiving, some frames (around 256 bytes) are not received.
    • I am using the UART driver module and initiating the UART with the function APP_UART_FIFO_INIT(...) so I assume that I am enabling the fifo OK. However, one curious thing is that I do not see any important effect when I change the size of the buffer from 1 to 1024 or vice-versa. I think that the error is related with the FIFO itself. However, I don't know if the CTS signal is settled by the uC itself or by the PC that is receiving the data through UART. Does anyone have an idea of what I am missing?
Children
No Data
Related