Microchip® Advanced Software Framework

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

This example demonstrates a simple configuration of 2 PWM synchronous channels to generate variable duty cycle signals. The duty cycle values are updated automatically by the Peripheral DMA Controller (PDC), which makes 2 on-board LEDs glow repeatedly.

Requirements

This example can be used on any SAM3/4 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. Configure PDC transfer for PWM duty cycle update
  6. Enable interrupt of PDC Tx end and PIN_PWM_LED0_CHANNEL
  7. Update synchronous period, dead time and override output via UART Console
  8. Restart PDC transfer in ISR