- BRD4001A Rev A01 SiLabs WSTK reffered as Mainboard
- BRD4308A Rev A01 (MGM210P032JIA) reffered as Radio Board
- Gecko SDK v2.7.9 -> Bluetooth SDK v2.13.9.0
- Simplicity Studio v4
- GNU ARM GCC v7.2.1
The project provides an example for accessing peripherals on SiLabs MGM210P032JIA module along with BLE stack running. Radio Board BRD4308A has MGM210P032JIA module. The module is based on the EFR32MG21 SoC.
Executable binaries are in ./GNU ARM v7.2.1 - Default
The ./app.c
and ./app.h
contains event handler for BLE.
Files ./peripheral_utils.c
and ./peripheral_utils.h
contain functions that deal with peripherals on SoC.
When Testing with mobile app, you will see following list of Custom Services and Characteristics. You might not see the names mentioned below but you will see the {UUID}. This can also be seen in Visual GATT Editor by opening ./soc-peripherals-on-MGM210P032.isc
Peripheral Test {686d7b33-129f-4532-89c1-c502c6159bb3}
- LED0 {abe6b815-d38c-476e-ae7e-dd1d62e209de}
- Type: USER
- Size: 1 byte
- BUTTON1 {ebff5ca7-0398-422a-a0ea-63fefb0765ec}
- Type: HEX
- Size: 1 byte
- ADC DATA {bb7b889f-587e-421f-a3b4-c3654998a742}
- Type: USER
- Size: 5 byte
- UART2 Data {9b475432-881f-418a-98ca-003c65339261}
- Type: HEX
- Size: 80
- LED
Mainboard has 2 on board LEDs out of which LED0 is used. This LED is connected to GPIO PB0. Therefore, GPIO PB0 is set as output. Characteristic LED0 is used which accepts following values
Value | Action |
---|---|
0 | Turn OFF LED |
1 | Turn ON LED |
2 | Toggle LED |
Mainboard has 2 on board push buttons out of which Button1 is used. This Button is connected to GPIO PB1. Therefore, GPIO PB1 is set as input. Characteristic BUTTON1 is used convey number of button presses.
Every button press generates a GPIO interrupt. The ISR keeps a counter for the number of times the button was pressed and generates a signal (SW interrupt to BLE stack). This signal raises an event in BLE stack. Using this event Client is notified of the counter value everytime button is pressed.
ADC Configurations | Value |
---|---|
Mode | Single input |
Port and Pin | PC02 |
Trigger Action | Once |
Over Sampling Ratio | 2x |
CLK_ADC_FREQ |
1,000,000 -> 1MHz |
CLK_SRC_ADC_FREQ |
1,000,000 -> 1MHz |
- If Trigger Action was set to Continuous, then according to formula on pg14 of AN1189: Incremental Analog to Digital Converter (IADC), the converion time would be
Conversion Time = 10/1,000,000
This means Samples per seconds = 1,000,000/10 = 100,000 = 100ksps - Since, we are using Trigger Action as Once and we are invoking IADC every second using BLE stack soft timer, the effective Samples Per Second = 1 sps
- Enabling the notification will start the soft timer and also trigger IADC.
UART Configuration | Value |
---|---|
Tx Port and Pin | PC00 |
Rx Port and Pin | PC01 |
Baud Rate | 115200 |
Flow Control | No |
Data Size | 8 bit |
Parity | None |
- The MGM210P has 3 USARTs, USART2 and been configured as asynchronous USART (i.e. UART). Since Rx can only take place in EM0 and EM1 the EM2 sleep must be blocked when MCU wants to receive the data.
- Enabling notification will allow MCU to receive the data.
- EFR32xG21 Reference Manual - https://www.silabs.com/documents/public/reference-manuals/efr32xg21-rm.pdf
- MGM210P Data Sheet - https://www.silabs.com/documents/public/data-sheets/mgm210p-datasheet.pdf
- BRD4308A User Guide - https://www.silabs.com/documents/public/user-guides/ug388-brd4308a-user-guide.pdf
- Peripheral Examples - https://github.com/SiliconLabs/peripheral_examples/tree/master/series2
- AN1189: Incremental Analog to Digital Converter (IADC) - https://www.silabs.com/documents/public/application-notes/an1189-efr32-iadc.pdf
- AN0012: General Purpose Input Output - https://www.silabs.com/documents/public/application-notes/an0012-efm32-gpio.pdf
- Bluetooth Software API Reference Manual - https://www.silabs.com/documents/public/reference-manuals/bluetooth-api-reference.pdf