This project configures multiple peripherals to work together in low power EM2 mode.
Peripherals used: ADC, LETimer, LDMA, GPIO, PRS, EMU, SPI
- GSDK 4.4.3
- Connect the board via a 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 device to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by peripherals and em2.
-
Click the Create button on the Platform - Using Autonomous Peripherals in Low Power EM2 Mode 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.
-
Copy the files
app.c
,graph.h
andgraph.c
into the project root folder (overwriting the existing file). -
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:
- [Platform] → [Peripheral] → [ADC]
- [Platform] → [Peripheral] → [PRS]
- [Platform] → [Peripheral] → [LDMA]
- [Platform] → [Peripheral] → [LETIMER]
- [Platform] → [Driver] → [GLIB Graphics Library]
- [Platform] → [Board] → [Board Control] → Turn on "Enable Display"
-
Build and flash the project to your device.
The application is capable of triggering the ADC Conversion from a GPIO button press or a LETIMER timeout through PRS while in EM2. Selecting the triggering source is done by uncommenting the line code in the app.c
file.
// Uncomment for selecting the triggering source
//#define GPIO_TO_ADC_PRS_MODE
#define LETIMER_TO_ADC_PRS_MODE
Once the ADC conversion is completed, the system transitions to EM1 and the LDMA copies the data into a buffer. Once the buffer is full, an LDMA interrupt is triggered to get the device out of EM2 and update the display. The display plots the recorded points and goes back to EM2 once complete.
Flash the project to your device. Observe the LCD screen on the board. You should expect a similar output to the one below.