New 32-bit peripheral example projects on GitHub (Updated 2 March 2020)
01/23/2018 | 10:31 PM
This discussion and its replies are closed
We've been working here to create a few more examples for EFM32/EFR32 devices that show basic examples of how to operate the device's peripherals. If you're familiar with our EFM8/C8051 examples, this is a similar setup. Basically, each peripheral (adc, gpio, i2c, etc) has a set of bare-bones examples that demonstrate some operation mode of the peripheral. Not all peripherals or modes are currently covered, but we will be adding more in the future.
Edit 8/27/18: We've pushed a ton of new examples - check it out!
Edit 3/12/19: We are migrating our discussion, questions, and bug reports for the 32-bit peripheral examples to the Issues section of the Github repository. This will allow us to track bugs and feature requests more easily.
Edit 5/24/2019: We've added Series 2 examples, as well as cleaned up the repo structure.
Edit 3/2/2020:
- Add examples for EFR32xG22 Wireless SoC
- Migrate AN0012 GPIO examples for series0, series1, and series2 to the
peripheral_examples repo (previously not version controlled)
Discussion Forums
32-bit MCUs
Unanswered
...
Correct Answer
4
Very handy for learning how to get started with a peripheral!
1
It will be very good if there will be good examples working with USB...
0
This is great stuff and it will assist a lot of Bluetooth customers as well. I referenced the github project from the Bluetooth KBA Master List.
1
Hi I'm trying to use pulse_width_modulation_dma on an EFM32PG1B200F256GM48. When I include the necessary em_dma.c file in /emlib, the files does not get compiled because DMA_PRESENT is not defined.
In the EFM32 reference manual it mentions a DMA controller so why is DMA_PRESENT not defined? If DMA is not useable on this EFM32 model. Where are some references to set up PWM?
Can you put some examples for adc in EFM32GG1B820F2048 mcu specially the part where one needs to configure the APORT. THe APort configuration is not very clear in the datasheet or the reference manual.
Thanks
Parag
0
Hello Parag,
We are working on creating EFM32GG11 examples. For now, APORT configuration will be just like other EFM32 Series 1 devices such as EFM32PG12. In general, use this process for APORT selection/configuration:
Step 1: Look at the APORT map in the datasheet for the desired peripheral. For example, on EFM32PG12, to find the APORT channel corresponding to pin PC9 as an ADC input, look at the ADC APORT map in the datasheet:
As you can see, PC9 is connected to the ADC via APORT1Y CH9. It is also connected to the ADC via APORT2X CH9.
Step 2: In firmware, select the APORT channel using the peripheral's init struct. Using the EFM32PG12 ADC as an example again, here is the code:
Just seconding BrianL about the new updates! Our interns were phenomenally productive this summer and added a massive number of new examples, as well as making sure that previous examples were ported to new device/board combinations.
EFR32 folks should really appreciate this as we should have most examples available now for at least one radio board in the xG1, xG12, xG13, and xG14 families.
0
Very nice to have, especially on Github. I notice the gpio examples use a deprecated intconfig function. I assume github is the best place to mention that?
0
oesys, I don't know if it's the "best place", but I did report an issue on GitHub and received a response.
New 32-bit peripheral example projects on GitHub (Updated 2 March 2020)
We've been working here to create a few more examples for EFM32/EFR32 devices that show basic examples of how to operate the device's peripherals. If you're familiar with our EFM8/C8051 examples, this is a similar setup. Basically, each peripheral (adc, gpio, i2c, etc) has a set of bare-bones examples that demonstrate some operation mode of the peripheral. Not all peripherals or modes are currently covered, but we will be adding more in the future.
The repo can be found here: https://github.com/SiliconLabs/peripheral_examples
-Brian
Edit 8/27/18: We've pushed a ton of new examples - check it out!
Edit 3/12/19: We are migrating our discussion, questions, and bug reports for the 32-bit peripheral examples to the Issues section of the Github repository. This will allow us to track bugs and feature requests more easily.
Edit 5/24/2019: We've added Series 2 examples, as well as cleaned up the repo structure.
Edit 3/2/2020:
Hi I'm trying to use pulse_width_modulation_dma on an EFM32PG1B200F256GM48. When I include the necessary em_dma.c file in /emlib, the files does not get compiled because DMA_PRESENT is not defined.
In the EFM32 reference manual it mentions a DMA controller so why is DMA_PRESENT not defined? If DMA is not useable on this EFM32 model. Where are some references to set up PWM?
please add an example how to use the simulated eeprom.
Silabs has dedicated application note an0019 that cover eeprom simulation.
Hello,
I didn't find SPI in the package ? Is there an example for spi ?
Thank you very much,
ranran
Hi, ranran,
SPI functionality is implemented within the USART peripheral. Check out the SPI Master and Slave examples here: https://github.com/SiliconLabs/peripheral_examples/tree/public/usart
-Michael
Hi
Can you put some examples for adc in EFM32GG1B820F2048 mcu specially the part where one needs to configure the APORT. THe APort configuration is not very clear in the datasheet or the reference manual.
Thanks
Parag
Hello Parag,
We are working on creating EFM32GG11 examples. For now, APORT configuration will be just like other EFM32 Series 1 devices such as EFM32PG12. In general, use this process for APORT selection/configuration:
Step 1: Look at the APORT map in the datasheet for the desired peripheral. For example, on EFM32PG12, to find the APORT channel corresponding to pin PC9 as an ADC input, look at the ADC APORT map in the datasheet:
As you can see, PC9 is connected to the ADC via APORT1Y CH9. It is also connected to the ADC via APORT2X CH9.
Step 2: In firmware, select the APORT channel using the peripheral's init struct. Using the EFM32PG12 ADC as an example again, here is the code:
Just seconding BrianL about the new updates! Our interns were phenomenally productive this summer and added a massive number of new examples, as well as making sure that previous examples were ported to new device/board combinations.
EFR32 folks should really appreciate this as we should have most examples available now for at least one radio board in the xG1, xG12, xG13, and xG14 families.