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
  • Sending 26 bytes of data every 250us with 1Mbaud is not possible if you are using 1 startbit, 1 stopbit and 8 databits. The maximum theoretical speed using 1Mbaud is:

     1Mbaud per second / 10 bauds(bits) per byte = 100KB/s
    

    The real number would be lower when taking into considerations time between the bytes and overhead in the CPU.

    This does not explain why you lose a byte though. Which byte is missing (first, last, in the middle)? Better hook up your oscilloscope/logic analyzer to see what is actually happening.

    Also, with 1MBaud the RX/TX lines should be very short or else you will get problems.

Reply
  • Sending 26 bytes of data every 250us with 1Mbaud is not possible if you are using 1 startbit, 1 stopbit and 8 databits. The maximum theoretical speed using 1Mbaud is:

     1Mbaud per second / 10 bauds(bits) per byte = 100KB/s
    

    The real number would be lower when taking into considerations time between the bytes and overhead in the CPU.

    This does not explain why you lose a byte though. Which byte is missing (first, last, in the middle)? Better hook up your oscilloscope/logic analyzer to see what is actually happening.

    Also, with 1MBaud the RX/TX lines should be very short or else you will get problems.

Children
No Data
Related