nRF5 SDK v11.0.0
Experimental: Asynchronous Transmitter
This example requires the following SoftDevice: S212

Important: Before you run this example, make sure to program the SoftDevice.

The purpose of this example is to demonstrate how to configure a channel as an asynchronous transmitter to implement a remote control application that transmits data immediately after a button push. Fast channel initiation is used together with the asynchronous transmission to ensure that data is transmitted as quickly as possible. Since transmissions are only performed as a response to user initiated events, the remote control is able to sleep for extended periods of time, reducing its power consumption.

Description

This example sends the control command as an acknowledged message, retrying up to a maximum number of times to ensure that it has reached its destination. The use of fast channel initiation and sporadic transmissions increases the risk of overlapping transmissions between multiple remotes. To address this, this example implements an application level random back-off scheme to limit over-the-air collisions between multiple asynchronous transmitters.

An asynchronous transmitter needs to be paired with a node in continuous scanning mode in the receiving end. In this example, the asynchronous transmitter is paired with an ANT USB stick and the Antware PC application configured in continuous scanning mode.

ant_async_transmitter.svg
Asynchronous Transmitter paired with an ANT USB stick

After start up, the asynchronous transmitter node will configure an ANT master channel using the extended assignment to set it up as an asynchronous transmitter with fast channel initiation. The channel is configured with the following parameters:

Parameter Value
Channel type Master (0x10)
Extended assignment EXT_PARAM_ASYNC_TX_MODE | EXT_PARAM_FAST_INITIATION_MODE
Network key Public {0, 0, 0, 0, 0, 0, 0, 0}
RF channel 66 (2466 MHz)
Device number Serial number
Device type 2
Transmission type 1

Message format

The channel is never opened. Instead, on a button press, the node will send a single acknowledged message over the channel configured in asynchronous mode; the message will be transmitted immediately. If the acknowledgement fails, the node will retry after a randomly generated time, using a timer to trigger the next transmission. A sequence number is used to differentiate between transmitted messages.

The format of messages used by this example is detailed below:

Byte Description
0 Command Page (0x01)
1-5 Reserved (0xFF)
6 Sequence number
7 Command ID:
0x10 = Command 0
0x11 = Command 1

Command 0 is transmitted when BSP_BUTTON_0 is pressed, while Command 1 is transmitted when BSP_BUTTON_1 is pressed.

Setup

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

Testing

  1. Compile and program the Asynchronous Transmitter application.
  2. Run AntWare II. Select your ANT PC dongle (for example, ANTUSB-m) from the available devices. Configure the device channels by loading the device profile configuration from the following file: <InstallFolder>\examples\ant\experimental\ant_async_transmitter\ant_async_transmitter_test.xml. Alternatively, you can configure the device channels manually:
    1. Set the channel assignment to slave.
    2. Set the channel ID to "0, 2, 1".
    3. Keep the default for all other settings.
  3. Select the “Advanced” tab in AntWare II. Click “Open in Scan Mode”.
  4. Press BSP_BUTTON_0 and then BSP_BUTTON_1. Observe received payload in AntWare II:
    Received ACKNOWLEDGED_DATA_0x4F
      :: 4f, 00-01-FF-FF-FF-FF-FF-00-10
    Received ACKNOWLEDGED_DATA_0x4F
      :: 4f, 00-01-FF-FF-FF-FF-FF-01-11
    

Documentation feedback | Developer Zone | Updated