This blog is to describe how many difference approaches to use the UART driver on the nRF52 Series.
Background
Inside the nRF52 series product specification, there are two difference UART perpherals.
- UART (Legacy) — similar to NRF51 series
- UARTE (Enhance UART driver with Easy DMA).
All information Length of UARTE DMA can be found at SDK folder SDK\modules\nrfx\mdk.

Chipset | Maximum length of UARTE DMA (bit) |
NRF52810 | 10 (1024 bytes) |
NRF52811 | 14 (4096 bytes) |
NRF52832 | 8 (256 bytes) |
NRF52840 | 16 (65536 bytes) |
By using the UARTE, it needs to specify the length of EasyDMA. The RX received complete event would only be triggered if the number of received byte reaches the DMA length. Otherwise, the UARTE would be still in the data receiving window.
There are some discussions of UARTE on the Nordic Devzone.
- https://devzone.nordicsemi.com/f/nordic-q-a/29197/uarte-receive-timeout-rxto
- https://devzone.nordicsemi.com/f/nordic-q-a/9604/nrf52-uarte-receive-timeout
- https://devzone.nordicsemi.com/f/nordic-q-a/13024/uart-receive-in-background-without-callback-on-nrf52-sdk11/49653#49653
In order to improve the flexibility of UARTE usage, an experimental driver LibUARTE is introduced inside the Nordic SDK. It uses the 2 x timers + PPI to trigger the timeout event as RXTO if the received data is not reached the MAXCNT on UARTE DMA.
https://devzone.nordicsemi.com/f/nordic-q-a/41215/general-libuarte-questions
Hardware configuration
2-Wire UART

3-Wire UART


The INACTIVE notification is right after the radio goes inactive, regardless of the notification distance configured. In other words, the notification distance only applies to the ACTIVE signal, if enabled.
Note that the timings (ACTIVE notification distance, the phrase “right after the radio goes inactive”) refers to the instance where the software interrupt is set pending. The time you observe that the interrupt handler is executing may vary depending on the CPU activity at the different priority levels.
Tutorial how to use the radio notification
https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/radio-notification
Radio Notification can be used as the RADIO status at the nRF52 Series. When the Radio is active, external HOST MCU doesn’t allow to send the data. It is used to prevent the high priority interrupt (RADIO) to interrupt the UART interrupt which may cause some data lost particular by using the Legacy UART. This is a simple flow control.
4-Wire UART

6-Wire UART Connection
- 2 Wire Standard UART + 4 extra wire proprietary flow control


Sequence of the RX (nRF52) as example
Step 1: if the MCU would like to send the data to nRF52, the TX data request pin is pulled down (active low) on request.
Current Consumption on the nRF52 DK board
Benchmark on the current consumption
- Connectable Undirected Advertising
- Advertising Payload = 25 bytes
- TX Power = 0 dBm
- VDD voltage = 3.0 with DCDC
- Advertising interval = 1000 msec

Case 1 :
- Add the app_uart (UARTE with DMA) enable
// <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
//==========================================================
#ifndef UART_ENABLED
#define UART_ENABLED 1
#endif
// <q> UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA
#ifndef UART_EASY_DMA_SUPPORT
#define UART_EASY_DMA_SUPPORT 1
#endif
// <q> UART_LEGACY_SUPPORT - Driver supporting Legacy mode
#ifndef UART_LEGACY_SUPPORT
#define UART_LEGACY_SUPPORT 1
#endif

Case 2:
- Add the app_uart (with legacy) enable
// <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
//==========================================================
#ifndef UART_ENABLED
#define UART_ENABLED 1
#endif
// <q> UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA
#ifndef UART_EASY_DMA_SUPPORT
#define UART_EASY_DMA_SUPPORT 0
#endif
// <q> UART_LEGACY_SUPPORT - Driver supporting Legacy mode
#ifndef UART_LEGACY_SUPPORT
#define UART_LEGACY_SUPPORT 1
#endif

How can I initialize UART1 with 9600baud speed ?
I want to use UART0 and UART1, any example ?
thanks
LikeLike