This repository contains examples of bare metal source code for Timer/Counter Type A (TCA), as described in the TB3217-Getting Started with Timer/Counter Type A (TCA) document from Microchip. The repository contains an Atmel Studio Solution with multiple projects inside:
- Generating a Dual-Slope PWM Signal: This use case shows how to generate a dual slope 16-bit PWM signal with 1 kHz frequency and 50% duty cycle on a GPIO pin (for more details, see Generating a Dual-Slope PWM Signal)
- Generating Two PWM Signals in Split Mode: This use case shows how to initialize the timer in Split mode to generate two single-slope 8-bit PWM signals on two GPIO pins, with independent duty cycle and frequency (for more details, see Generating Two PWM Signals in Split Mode)
- Using Periodic Interrupt Mode: This use case shows how to initialize the timer in Single mode to work as a counter. The counter overflows every 250 ms and triggers an interrupt which toggles a pin (for more details, see Using Periodic Interrupt Mode)
More details and code examples on the ATMEGA4809 can be found at the following links:
- TB3217-Getting Started with Timer/Counter Type A (TCA)
- ATMEGA4809 Product Page
- ATMEGA4809 Code Examples on GitHub
- ATMEGA4809 Project Examples in START
- Microchip Studio 7.0.2542 or newer (https://www.microchip.com/mplab/microchip-studio)
- ATmega_DFP 1.6.364 or newer Device Pack
- ATMEGA4809 Xplained Pro (ATMEGA4809-XPRO)