Skip to content

This repository contains examples of MCC Melody generated source code for the TCE and WEX peripherals of the AVR EB family of devices.

License

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/avr16eb32-getting-started-with-tce-and-wex-mplab-mcc

Repository files navigation

MCHP

Getting Started with Timer/Counter Type E (TCE) and WEX MCC Melody

This repository contains examples of MPLAB® Code Configurator (MCC) Melody source code for the new Timer/Counter Type E (TCE) and Waveform Extension (WEX) peripherals of the AVR® EB family of devices. There are three applications described in this document. Each application's functionality is explained.

  • Generate PWM Signals Using TCE: In this use case, the TCE timer is initialized in Dual Slope Mode to generate four Pulse-Width Modulation (PWM) signals with different duty cycles, scaling and high resolution option.
  • Generate Patterns Using WEX: This example shows how to use WEX to generate different patterns, and take control of the TCE pins during run time, without stopping the timer. This is extremely useful for applications like trapezoidal motor control for example, where some PWM signals must be forced to low 0 logic depending on the commutation sector.
  • Generate Eight Complementary Pulse-Width Modulation Signals Using TCE and WEX modules: In this example the TCE timer is initialized in Single Slope mode and generates four PWM signals. WEX is configured to split the four PWM signals into eight complementary PWM signals with dead time. The PWM signals have different duty cycles, that get incremented in 0-100% range minus dead time. Duty cycles increment happens in Interrupt Service Routines (ISR) during each Compare Register interrupt. A fault is triggered every 250 μs, driving all the outputs to low 0 logic. Then the fault is cleared and normal operation is restored. After that, the process repeats itself over and over again.

Related Documentation

More details and code examples on the AVR16EB32 can be found at the following links:

Software Used

Hardware Used

Setup

The AVR16EB32 Curiosity Nano Development board is used as test platform.


About

This repository contains examples of MCC Melody generated source code for the TCE and WEX peripherals of the AVR EB family of devices.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published