Skip to content

Latest commit

 

History

History

platform_multi_channel_pwm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Platform - Multi Channel PWM

Type badge Technology badge License badge SDK badge Build badge Flash badge RAM badge

Overview

The example demonstrate the timer/letimer peripherals configuration in a way, that multiple channels are used and generate a PWM signal on certain GPIO pins.

Gecko SDK Version

  • GSDK v4.4.3

Hardware Required

Connections Required

  • Connect the board via a micro-USB cable to your PC to flash the example.

Setup

To test this application, you can either create a project based on an example project or start with an empty example project.

Create a project based on an example project

  1. Make sure that this repository is added to Preferences > Simplicity Studio > External Repos.

  2. 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 multi and pwm.

  3. Click the Create button on the Platform - Multi Channel PWM example. Example project creation dialog pops up -> click Finish and Project should be generated.

    Create_example

  4. Build and flash this example to the board.

Start with an empty example project

  1. Create an Empty C Project project for your hardware using Simplicity Studio 5.

  2. Replace the app.c file in the project root folder with the provided app.c (located in the src folder).

  3. Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:

    • [Platform] → [Peripheral] → [TIMER]
  4. Build and flash the project to your device.

How It Works

TIMER0 is initialized for PWM on 3 channels (0, 1, and 2) and routed to GPIO pins. PWM duty cycle on channel 0 increases from 0 -> 100%, whereas duty cycle on channel 1 decreases from 100 -> 0%. You can modify the GPIO pins configuration to the LEDs pin on the wireless starter kit or use an oscilloscope to see how PWM works on each channel.

result