Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PWMA Example 1 for STK600_RCUC3L0 Documentation

Introduction

This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the PWMA driver.
It also gives an example of the usage of the PWMA module.
This example will generate PWMA output waveform on two different channels and generates interrupt when overflow occurs in the timebase counter. It updates the duty cycle value using Interlinked multi-value mode This can update four different channels simultaneously with four different duty cycle values. The CPU will enter in to sleep mode (Frozen).
The output PWMA frequency configured in this example is 2MHz and the SPREAD is loaded with the value of 10. So, the output frequency will vary from 1.4MHz to 3.4MHz. The duty cycle value of one channel is 11 which is 50% duty cycle. For 2nd channel, the duty cycle value is 5, which is 25%.

Main files

References

  • Respective device datasheet
  • Respective Board Schematics
  • Schematics of the respective Routing card {for STK600 Board)

Compiler Support

This example application supports

  • GNU GCC for AVR32
  • IAR EWAVR32 for UC3L064 device

Device support

  • AT32UC3L0 Series
  • ATUC[64/128/256]L3/L4 devices
  • ATUC[64/128]D3/D4 devices

Test Information

This example has been tested with the following boards:

  • UC3L-EK evaluation kit with an AT32UC3L064 MCU.
  • UC3L0-Xplained kit with an AT32UC3L064 MCU.
  • STK600 + RCUC3L0 routing card with an AT32UC3L0256 MCU.
  • STK600 + RCUC3D routing card with an ATUC128D3 MCU.
  • STK600 + RCUC3L3U routing card with an ATUC256L3U MCU.

Hardware Setup Information

  • CPU Clock Source : DFLL(48MHz) with internal RCSYS as source PLL(48MHz) with OSC0 as source for UC128D3 MCU
  • CPU Speed : 48MHz
  • PBA Speed : 48MHz
  • PBB Speed : 48MHz
  • PWMA_GCLK Source : PBA Clock
  • PWMA_GCLK Speed : 48MHz

Hardware Setup Information

In UC3L0-XPLAINED KIT:

  • PWMA Channels used : channel 11 and channel 27
  • The PWMA output channel is routed to LED0 and LED1 respectively.
  • The output can also be measured with Oscilloscope as given below:
    -----------------------------------------------------------—
    | PWMA Channel | LED on Board | OUTPUT pins on Board |
    -----------------------------------------------------------—
    | channel 11 | LED0 | Pin 8(PWMA7) of Header J3 |
    | channel 27 | LED1 | Pin 7(PWMA6) of Header J3 |
    -----------------------------------------------------------—
  • The LED2 will be turned on in case of any failure in the PWMA configuration.

In UC3L-EK KIT:

  • PWMA Channels used : channel 21 and channel 33
  • The PWMA output channel is routed to LED0 and LED1 respectively.
  • The output can also be measured with Oscilloscope as given below:
    -----------------------------------------------------------—
    | PWMA Channel | LED on Board | OUTPUT pins on Board |
    -----------------------------------------------------------—
    | channel 21 | LED0 | Pin 7(PA21) of Header J15 |
    | channel 33 | LED1 | Pin 16(PB10) of Header J15 |
    -----------------------------------------------------------—
  • The LED2 will be turned on in case of any failure in the configuration
    For STK600 + RCUC3L0 routing card with an AT32UC3L0256 MCU:
  • PWMA Channels used : channel 9 and channel 11.
  • Pin mapping in STK600: --------------------------------------—
    | PWMA Channel | Port No. | In STK600 |
    --------------------------------------—
    | channel 9 | PA09 | PortB.PB1 |
    | channel 11 | PA11 | PortB.PB3 |
    --------------------------------------—
  • Output can be measured through oscilloscope or it can be connected to LEDs on the STK600 board.
  • The port PA08 (portB.PB0 in STK600) can be connected to any of the LEDs on the board. This will be turned on in case of any failure in the PWMA configuration.
    For STK600 + RCUC3D routing card with an ATUC128D3 MCU:
  • PWMA Channels used : channel 0 and channel 2
  • Before start programming, switch the clock to external(EXT) in the STK600 board. And in programming window, write the Oscillator frequency as 12MHz in the Board Settings options.
  • Pin mapping in STK600: --------------------------------------—
    | PWMA Channel | Port No. | In STK600 |
    --------------------------------------—
    | channel 0 | PA11 | PortB.PB3 |
    | channel 2 | PA13 | PortB.PB5 |
    --------------------------------------—
  • Output can be measured through oscilloscope or it can be connected to LEDs on the STK600 board
  • The port PA08 (portB.PB0 in STK600) can be connected to any of the LEDs on the board. This will be turned on in case of any failure in the PWMA configuration.
    For STK600 + RCUC3L3U routing card with an ATUC256L3U MCU:
  • PWMA Channels used : channel 0 and channel 2
  • Pin mapping in STK600: --------------------------------------—
    | PWMA Channel | Port No. | In STK600 |
    --------------------------------------—
    | channel 9 | PA09 | PortB.PB1 |
    | channel 11 | PA11 | PortB.PB3 |
    --------------------------------------—
  • Output can be measured through oscilloscope or it can be connected to LEDs on the STK600 board
  • The port PA08 (portB.PB0 in STK600) can be connected to any of the LEDs on the board. This will be turned on in case of any failure in the PWMA configuration.

Contact Information

For further information, visit : Atmel AVR32 .
Technical support & faq, visit : Support and FAQ .

Author
Microchip Technology Inc : http://www.microchip.com