nRF5 SDK v15.3.0
Serial Port Library Example with two UARTEs

This example shows how to use the Serial port library with two UARTEs. It defines two instances of the serial port interface: one for receiving data, and one for sending data. After power-up, the example sends a "Hello nrf_serial!" string to the J-Link serial port. Then, it starts operating in loopback, which means that it sends every byte that it receives through the first serial instance back to the serial port through the second serial instance.

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\serial_uartes

Development Kit

The example requires you to short Arduino pins: SCL (P0.27) and SDA (P0.26).

serial_uartes.svg
Connections and data flow in the Serial Port Library Example

Testing

Test the Serial Port Library Example application by performing the following steps:

  1. Compile and program the application.
  2. Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 115.200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
  3. Press any letter or digit key on the PC keyboard and check the loopback functionality.

Documentation feedback | Developer Zone | Subscribe | Updated