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

nrf51822 TX bytes not back to back at 12K8 or 38K4 baud

We have a nrf51822 device that has to send 6 bytes back to back at 12K8 and 6-18 bytes at 38K4 in the future.

The bytes are in an array and do not need to be generated anymore.

Since the Bluetooth interrupt can be away for 3ms this generates a disruption in the communication.

I know that the uart can not have a level 0 interrupt, but I am wondering for means to send the bytes back to back.

  • Is there a TX FIFO that I am not aware of?
  • Is the easyDMA controller usable for the TX? (I saw it is usable for SPI)
  • Is there a way to get a little time within the softdevice's radio interrupt to copy bytes from the array to the TX reg (TX_ready check, get array pointer, copy action)

We need a quick answer if possible since the problem blocks a high prio project.

  • Without knowing what your application timing requirements for the UART are it's hard to suggest a exact solution. However, I can try to help with your questions:

    1. Is there a TX FIFO? There is no HW FIFO on the nRF51. There is a software TX FIFO implementation if you use the app_uart_put(); function and app_uart_fifo.c and app_fifo.c

    2. Is the easyDMA controller usable for TX? No, easyDMA is not available for the UART on the nRF51, it is on the nRF52 but that doesn't help you much here.

    3. Is there a way to get time in the radio interrupt to copy bytes? Not sure exactly what you need to do here. However, you can use the Radio Notification feature to make sure you can complete your UART work before the radio interrupts you. There is also a time slicing feature of the Soft Device that may be of use depending on what exactly you need here.

Related