Important: Before you run this example, make sure to program the SoftDevice .
The Broadcast example consists of basic example applications that can be used to test ANT connectivity between a master and a slave.
Transmitter
The transmitter application transmits a packet four times per second. Each transmission is indicated by BSP_INDICATE_SENT_OK .
Packet layout: {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, X }
The last byte of the packet ( X ) is incremented each time.
The name of the example is
ant_broadcast_tx_s210_
Board
, where
Board
is the supported board. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder:
<InstallFolder>\examples\ant\ant_broadcast\broadcast_tx
Receiver
The receiver application receives a packet four times per second. Each successful transmission is indicated by BSP_INDICATE_RCV_OK .
The name of the example is
ant_broadcast_rx_s210_
Board
, where
Board
is the supported board. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder:
<InstallFolder>\examples\ant\ant_broadcast\broadcast_rx
Tracing CPU load
Both applications allow the user to trace the load of the CPU. Every time when the processor enters sleep state, BSP_LED_0 is turned off. When the processor is woken up by an interrupt (RF or other), BSP_LED_0 is turned on.
Channel configuration
This example uses the default channel configuration:
| Parameter | Transmitter | Receiver |
|---|---|---|
| Channel type | Master TX Only (0x50) | Slave RX Only (0x40) |
| Network key | Public {0, 0, 0, 0, 0 , 0, 0, 0} | Public {0, 0, 0, 0, 0 , 0, 0, 0} |
| RF channel | 66 (2466 MHz) | 66 (2466 MHz) |
| Transmission type | 0x01 | 0x00 (Wildcard) |
| Device type | 0x02 | 0x00 (Wildcard) |
| Device number | 0x02 | 0x00 (Wildcard) |
| Channel period | 8192 (4 Hz) | 8192 (4 Hz) |
Testing
You can test the Broadcast example in different ways:
- Testing the Broadcast Transmitter with the Broadcast Receiver
- Testing the Broadcast Transmitter using AntWare II
- Testing the Broadcast Receiver using AntWare II
Testing the Broadcast Transmitter with the Broadcast Receiver
- Compile and program the Broadcast Transmitter. Observe that the transmitter board indicates BSP_INDICATE_SENT_OK (4 Hz).
- Compile and program the Broadcast Receiver. Observe that the receiver board indicates BSP_INDICATE_RCV_OK (4 Hz).
Testing the Broadcast Transmitter using AntWare II
- Compile and program the Broadcast Transmitter. Observe that the transmitter board indicates BSP_INDICATE_SENT_OK (4 Hz).
- Run AntWare II. Select your ANT PC dongle (for example, ANTUSB-m) from the available devices. Configure the device channel according to the Channel configuration for the receiver.
-
Click the Auto-Open button. Observe that messages describing the received payload appear for each ANT message. These messages should look similar to the following fragment:
Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-01 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-02 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-03 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-04 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-05 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-06
Testing the Broadcast Receiver using AntWare II
- Run AntWare II. Select your ANT PC dongle (for example, ANTUSB-m) from the available devices. Configure the device channel according to the Channel configuration for the transmitter.
- Compile and program the Broadcast Receiver. Observe that the receiver board indicates BSP_INDICATE_RCV_OK (4 Hz).
- Click the Auto-Open button. Observe that the receiver board indicates BSP_INDICATE_RCV_OK (4 Hz).