Enhanced ShockBurst: Transmitter/Receiver

The Enhanced ShockBurst Transmitter/Receiver sample shows the basic steps that are needed to transmit and receive packets using Enhanced ShockBurst (ESB).

Overview

The sample consists of two applications, one Transmitter and one Receiver, that use the Enhanced ShockBurst library. After programming each application on an nRF5 development board, you can test that packets that are sent by the board that runs the Transmitter application are picked up by the board that runs the Receiver application. Successful communication is indicated by LED changes, which should be in sync on both boards.

Transmitter

The Transmitter example sends a packet, waits for a configurable time (50 milliseconds by default), and then sends another packet. In each packet, the four least significant bits of the first byte of the payload are incremented (or reset to zero when they reach 16). The LEDs indicate that packets were sent and acknowledged. Therefore, if packets are successfully received and acknowledged by the Receiver, the LED pattern will change every 50 milliseconds (with the default delay).

Receiver

The Receiver example listens for packets and sends an ACK when a packet is received. If packets are successfully received from the Transmitter, the LED pattern will change every time a packet is received.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Build target

nRF52840 DK

PCA10056

nrf52840dk_nrf52840

nrf52840dk_nrf52840

nRF52 DK

PCA10040

nrf52dk_nrf52832

nrf52dk_nrf52832

You can use any two of the development kits listed above and mix different development kits.

User interface

LED 1-4:

Indicate that packets are sent or received. The first four packets turn on LED 1, 2, 3, and 4. The next four packets turn them off again in the same order.

Building and running

The Transmitter sample can be found under samples/esb/ptx in the nRF Connect SDK folder structure. The Receiver sample can be found under samples/esb/prx in the nRF Connect SDK folder structure.

See Building and programming a sample application for information about how to build and program the application.

Testing

After programming the Transmitter sample on one of the boards and the Receiver sample on the other board, test them by performing the following steps:

  1. Power on both boards.

  2. Observe that the LEDs change synchronously on both boards.

  3. Optionally, connect to the boards with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.

  4. Observe the logging output for both boards.

Dependencies

This sample uses the following nRF Connect SDK libraries:

In addition, it uses the following Zephyr libraries: