Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PWM LED Example
Purpose

This example demonstrates a simple configuration of 2 PWM channels to generate variable duty cycle signals. The 2 LEDs on the evaluation kit will glow repeatedly.

Requirements

This example can be used on SAM boards. The 2 required leds need to be connected to PWM output pins, else consider probing the PWM output pins with an oscilloscope.

Usage
  1. Initialize system clock and pins setting on board
  2. Initialize PWM clock
  3. Configure PIN_PWM_LED0_CHANNEL
  4. Configure PIN_PWM_LED1_CHANNEL
  5. Enable interrupt of counter event and PIN_PWM_LED0_CHANNEL & PIN_PWM_LED1_CHANNEL
  6. Change duty cycle in ISR