| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ANT Advanced Burst
This example requires the following SoftDevice: S212

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

Advanced burst data transmission provides a mechanism to transfer bulk data with a maximum data throughput of 60 kbps. The transmission rate, along with optional features such as frequency hopping, is negotiated over the air, offering backward compatibility with implementations that support only standard burst. In order to sustain this data throughput, the application must ensure that data is available for transmission on a timely basis. One mechanism available to achieve this is buffering. ANT SoftDevices provide a burst handler that can queue arbitrary amounts of burst data for transmission by passing an input buffer with the data to send. While it is possible to place the entire burst data in the input buffer, this may not be a feasible option for large amounts of data due to RAM limitations.

The purpose of this example is to demonstrate how to send and receive large amounts of burst data while buffering smaller blocks of data (128 bytes) at a time. This example shows how to process the different ANT events to queue the next block of data for optimal throughput, as well as to determine the success or failure of the burst transfer. The example also shows how to split the received advanced burst data into 8-byte segments, resembling standard burst messages. For more details on burst transfers, refer to the application note ANT AN Burst Transfers.

This example is intended to be paired with an ANT USB stick and the ANTware II PC application configured as a slave.

Setup of the ANT Advanced Burst example

# Expected result

After startup, this example configures and opens an ANT master channel with the following channel parameters:

Parameter | Value
--- | ---
Channel type | Master (0x10)
Extended assignment | 0
Network | Public
Radio frequency | 66
Device number | Serial Number
Device type | 2
Transmission type | 1
Channel period | 8192 (4 Hz)

The advanced burst that is enabled by this example uses the following parameters:

Parameter | Value
--- | ---
Enable | ADV_BURST_MODE_ENABLE
RF payload size | ADV_BURST_MODES_MAX_SIZE (24 bytes)
Required features | 0 (none)
Optional features | 0 (none)

For more details on the different parameters used when configuring advanced burst, refer to Section 9.5.2.27 of the ANT Message Protocol and Usage document.

After successfully configuring and running this example, pressing BSP_BUTTON_0 on the board sends a burst transfer with BURST_TOTAL_PACKETS 8-byte packets. The burst is filled with dummy data. BSP_LED_0 turns on while the burst is in progress, either transmitting or receiving. BSP_LED_1 will turn on if the burst fails to complete.

# Setup

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

# Testing

Note: You can use a custom channel or encryption when running any of the ANT examples. When adding a new channel or encryption, remember to update ANT stack configuration.

Follow these steps to test the Advanced Burst example:

1. Compile and program the ant_advanced_burst application onto the module.
2. Plug in an ANT USB stick into the computer.
3. Open the ANTware II tool.
4. Configure the device channel by loading the device profile configuration from the following file: `<InstallFolder>\examples\ant\ant_advanced_burst\ant_advanced_burst_test.xml`.
   Alternatively, you can configure the device channel manually:
   1. Expand the device panel and select the Adv tab.
   2. Click Show Advanced Device Panel.
   3. Switch to the Adv. Burst tab and select the Standard tab under it.
   4. Configure the Pckts/AntMsg setting to 3 and select Enable. Click Set Config.
   5. Configure Channel 0 as a slave. Click Assign.
   6. Set the Device Type to 2 and the Transmission Type to 1. Set the Device Number to 0 (wild card).
   7. Set the Radio Frequency to 66.
   8. Set the Channel Period to 8192 (4 Hz).
5. Click Auto-Open.
6. Press BSP_BUTTON_0 on the development board. ANTware II will show the received burst data. BSP_LED_0 will turn on during the burst transfer.
7. In ANTware II, go to the Messaging tab and select the Burst tab.
8. Select the Counter bytes option, and set the length to 8192.
9. Click Start Transfer.
10. On the development board, BSP_LED_0 will turn on while the transfer is in progress. ANTware II will show that the burst was transmitted, whether it was successful or not, and the time spent during the transfer.