AVR128DA48 LED Blink Using a PWM Signal Code Example
 
 
 
Go to file
Iustinian Bujor cb61945cc2 MPAE-5596: Populated metadata file 2020-08-05 16:26:51 +03:00
.main-meta MPAE-5596: Populated metadata file 2020-08-05 16:26:51 +03:00
avr128da48-cnano-led-blink-pwm-mcc.X MPAE-5596: Added a .X project 2020-08-05 11:58:41 +03:00
images MPAE-5596: Added a .X project 2020-08-05 11:58:41 +03:00
.gitignore
Jenkinsfilek8s
README.md MPAE-5596: Added a .X project 2020-08-05 11:58:41 +03:00
cloudprovider.yml

README.md

MCHP

AVR128DA48 LED Blink using PWM Code Example

This repository provides a MPLAB X project with a MCC generated code example for an LED blink driven by a PWM signal. The example demonstrates how to generate a PWM signal using a timer. The output waveform is connected to the on-board LED. The PWM duty cycle value is set at 50%. For half of the period the LED is turned ON, and for the other half the LED is turned OFF.

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

Software Used

Hardware Used

Setup

The AVR128DA48 Curiosity Nano Development Board is used as test platform

The following configurations must be made for this project:

TCA1:

  • Single-slope PWM Mode
  • Compare channel 2 enabled
  • Input clock 4Mhz divided by 16
Pin Configuration
PC6 (LED0) Digital Output

Operation

  1. Connect the board to the PC.

  2. Open the avr128da48-cnano-led-blink-pwm-mcc.X project in MPLAB® X IDE.

  3. Set avr128da48-cnano-led-blink-pwm-mcc.X project as main project. Right click on the project in the Projects tab and click Set as Main Project.

  4. Select the AVR128DA28 Curiosity Nano in the Connected Hardware Tool section of the project settings:

  • Right click on the project and click Properties;
  • Click on the arrow right next to Connected Hardware Tool;
  • Select the AVR128DA28 Curiosity Nano (click on the SN), click Apply and then click OK:
  1. Program the project to the board: right click on the project and click Make and Program Device.

Demo:

Summary

The demo shows shows how to generate a PWM signal using Timer/Counter Type A (TCA). The output of the TCA is connected to the on-board LED of the AVR128DA48 Curiosity Nano board and a waveform signal is generated.