This project shows how to use the PG23 LCD peripheral on the BRD2504A board to perform auto animation and blink without CPU intervention.
The EFM32PG23 Pro Kit supports the segment LCD peripheral. This project displays specialized patterns on the segment LCD while the CPU is in EM2 sleep mode for energy saving and does not involve the LCD data registers.
More information on How it works below.
GSDK v4.4.3
- Board: Silicon Labs EFM32PG23 Pro Kit (BRD2504A)
- Device: EFM32PG23B310F512IM48
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 example project.
-
Make sure that this repository is added to Preferences > Simplicity Studio > External Repos.
-
From the Launcher Home, add your board to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by 'lcd animation'.
-
Click the Create button on the Platform - PG23 LCD Animation Blink example. Example project creation dialog pops up -> click Finish and the project should be generated.
-
Build and flash this example to the board.
-
Create an Empty C Project project for your hardware using Simplicity Studio 5.
-
Replace the
app.c
file in the project root folder with theapp.c
file in the src folder. -
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:
- [Platform] → [Peripheral] → [LCD]
- [Services] → [Power Manager] → [Power Manager]
-
Build and flash the project to your device.
The LCD peripheral can execute various animations without involving the LCD data registers as well as the CPU. It allows specialized patterns to run on the LCD panel while the CPU remains in Low Energy Mode.
A maximum of 8 segments can be used for the animation feature. They can either be segments 0-7 controlled by COM0 or segments 8-15 controlled by COM0. The animation is implemented as two programmable 8-bit registers that are shifted either left or right for every other animation state for a total of 16 states. The LCD_AREGA register is shifted in every odd state. The LCD_AREGB register is shifted in every even state. The two registers can either be OR'ed or AND'ed to achieve the desired animation pattern. The animation state machine is described in section 27.3.13.3 of the reference manual.
This example uses segments 0-7 that are controlled by COM0 to demonstrate the animation feature.
The LCD peripheral can also blink at a frequency given by CLKevent every 2Hz. The segments will be alternating between on and off when the LCD is blinking. Refer to section 27.3.13.1 of the reference manual for more information regarding the blinking feature.
For this example, the LCD segments controlled by the animation feature are 1D, 1C, 2D, P2, 3D, P3, 4D, 4C. Refer to the BRD2504A schematic for additional information.
- Build and flash the hex image onto the board. Reset the board and observe the segment LCD displaying animation at a 2Hz rate.
- Change BLINK_ENABLE define on line 30 of the
app.c
file to 1. - Rebuild and flash the hex image onto the board. Reset the board and observe the segment LCD displaying animation and blinking at a 2Hz rate. This example runs as it is and requires no user intervention.
Note:
The blink feature is not enabled in the video.