This project shows how to use the segment LCD peripheral on two different xG23 boards and PG28 pro kit to display timer functions.
- GSDK v4.4.3
- Silicon Labs EFR32FG23 Dev Kit (BRD2600A)
- Silicon Labs EFM32PG23 Pro Kit Board (BRD2504A)
- Silicon Labs EFM32PG28 Pro Kit Board (BRD2506A)
- 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 the BRD2504A to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by lcd and timer.
-
Click the Create button on the Platform - Segment LCD with Timer example. Example project creation dialog pops up -> click Finish and 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 the providedapp.c
(located in the src folder). -
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:
- [Platform] → [Board Drivers] → [Segment LCD]
- [Platform] → [Peripheral] → [LETIMER]
-
Build and flash the project to your device.
At first, the segment LCD displays 00000. Press Push Button 0 to start the timer.
The push buttons also have the following functionalities: Regular timer mode (default mode):
- Push Button 0 -> start/stop the timer
- Push Button 1 single click -> reset the timer
To configure the Compare mode:
- Push Button 1 hold for 2 or more seconds -> enter compare mode
- Push Button 0 -> configure the value of the timer to trigger compare match
- Push Button 1 -> exit compare mode setup
- Push Button 0 -> start timer and run the compare mode
- When compare match happens, the Segment LCD will blink with the current value
- Press Button 0 or 1 to exit compare mode when compare match happens
The segment LCD needs to be configured to display numerical values correctly on the selected board. This is taken care of by the LCD driver library. The LETIMER is configured to interrupt every 1 Hz and update the segment LCD accordingly. The GPIOs for the push buttons are configured as inputs and will interrupt once pressed to perform specific operations.