TX and RX Activity Indicator Pins#
Description#
This code example shows how to configure the TX and RX activity indicators when using Bluetooth SDK to follow/debug the timing of radio tasks.
The TX and RX activity signals can be used to monitor the radio activity. The following screen capture from logic analyzer shows an example where Channel 0 is showing the RX activity and Channel 1 is showing TX activity.
The image above shows one advertising event. The advertisement is transmitted on all three channels (three pulses in the TX indicator). After sending packet on one channel, the receiver is active for a short period of time so that possible connection or scan requests can be detected.
Setting up#
Create a new SoC-Empty project for your device.
Copy the attached app.c into your project.
Copy em_prs.c from platform/emlib/src in your SDK to the same folder in your project
The application calls a single function to enable these RX/TX activity pins.
After the call to
gecko_init()
, configure the TX and RX indicators to the desired pins (allowed range: port F, any pin). The example below outputs RX activity on PORTF6 and TX activity on PORTF7.enableDebugGpios(gpioPortF,6,gpioPortF,7);
Build your project and flash it to your device.
Usage#
SoC-empty example starts advertising by default. Therefore, if you connect a logic analyzer to the selected pins, you should observe the same activity as on the figure in the Description section. If you connect to your device via Bluetooth (e.g., with a smartphone), you will be also be able to observe the TX/RX activity going on during the connection.