This project shows how to use the LCD peripheral with the LDMA on the EFR32FG23 Dev Kit (BRD2600A) board and the EFM32PG28 Pro Kit (BRD2506A) board. The example updates the segment LCD in EM2 using the segment LCD driver.
- GSDK v4.4.3
NOTE:
Tested boards for working with this example:
Board ID | Description |
---|---|
BRD2600A | Silicon Labs EFR32FG23 Dev Kit |
BRD2506A | Silicon Labs EFM32PG28 Pro Kit Board |
Connect the board via a micro-USB cable to your PC to flash the example.
To test this application, you can either create a project based on an example project or start with an "Empty C Project" project based on your hardware.
-
Make sure that this repository is added to Preferences > Simplicity Studio > External Repos.
-
From the Launcher Home, add your hardware to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by "ldma".
-
Click the Create button on the Platform - Segment LCD with LDMA example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-
Build and flash this example to the board.
-
Create an "Empty C Project" for the "EFR32FG23 Dev Kit board" or "EFM32PG28 Pro Kit board" using Simplicity Studio v5. Use the default project settings.
-
Copy the file
src/app_fg23.c
(for EFR32FG23 Dev Kit board) orsrc/app_pg28.c
(for EFM32PG28 Pro Kit board) into the project folder (replace the existingapp.c
file). -
Install the software components:
-
Open the .slcp file in the project.
-
Select the SOFTWARE COMPONENTS tab.
-
Install the following components:
-
[Platform] → [Board Drivers] → [Segment LCD]
-
[Platform] → [Peripheral] → [LDMA]
-
-
-
Build and flash this example to the board.
The LCD peripheral is configured to send a DMA request on an LCD Frame Counter event every second. The LDMA uses looping linked-list descriptors to update the LCD_SEGn registers. A display buffer contains the desired values to write to the LCD_SEGn registers.
The LCD_SEGn registers are clocked by a different clock domain and must be synchronized in order for the register writes to take effect. The LCD peripheral is configured so the LCD_SEGn registers are automatically synced once the LCD_SEG3 register is written to.
The first descriptor sets the starting address of the display buffer as the base source address of the LDMA channel. The second descriptor is loaded and waits for a DMA request.
The second descriptor transfers the contents in the display buffer to the LCD_SEGn registers. This descriptor loops 9 times, and then the third descriptor is loaded.
The third descriptor updates the loop counter back to 9 and then loads the first descriptor.
You can observe the change on the LCD as follows: 00000
-> 11111
-> 22222
-> ...
-> 99999
-> 00000
after every second.
This example does not require processor intervention once entering EM2.