drojf / avr128da48-cnano-bootloader-mplabx

This repo provides two MPLAB X projects, represent a basic implementation of a Bootloader and a Host Application example for the AVR-DA family

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MCHP

Basic Bootloader for the AVR-DA Family (MPLAB X)

This repository contains the MPLAB X projects for a basic bootloader compatible with AVR-DA family, a host application and the flashing environment (Python™ scripts) used to upload the application image into the microcontroller's memory, as described in AN3341 - Basic Bootloader for the AVR MCU DA (AVR-DA) Family Application Note from Microchip.

Related Documentation

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.

Operation

In order to upload the application image follow this steps:

  1. Connect the board to the PC.

  2. Check the COM port the AVR128DA48 Curiosity Nano was connected to by opening Device Manager in Windows®:

  3. Open in MPLAB X the two projects:

  • avr128da48-cnano-avr-da-bootloader.X
  • avr128da48-cnano-avr-da-host-app.X
  1. Set avr128da48-cnano-avr-da-bootloader project as main project

  2. Clean and build the Bootloader project: right click on avr128da48-cnano-avr-da-bootloader project and select Clean and Build

  3. Clean and build the Host App project: right click on avr128da48-cnano-avr-da-host-app project and select Clean and Build

  4. Program avr128da48-cnano-avr-da-bootloader project to the board.

  5. Browse to scripts folder and open for editing SerialUpload.bat file. The python command has the following format:

python AVR-DA_uploader.py {path_to_hex_file} {flash_max_size} {COM_port} {baud_rate}

The parameters are:

  • {path_to_hex_file} - path to the executable file to be flashed, including its path
  • {flash_max_size} - maximum size of the flash in hexadecimal value
  • {COM_port} - the COM port where the AVR128DA48 Curiosity Nano is attached to
  • {baud_rate} - the baud rate of the serial communication

Note: For the current implementation, the baud rate for serial communication is configured in code as 9600.

Example:

  1. Replace {path_to_hex_file}, {flash_max_size}, {COM_port}, {baud_rate} fields with their actual values and save the file.

  2. Press SW0 button to make the Bootloader enter in "application flashing mode".

  3. Run SerialUpload.bat

Summary

This AN3341 - Basic Bootloader for the AVR MCU DA (AVR-DA) Family application note describes how the AVR® MCU DA (AVR-DA) family of microcontrollers (MCUs) can use self-programming. This enables the user to download application code into Flash without the need for an external programmer.

About

This repo provides two MPLAB X projects, represent a basic implementation of a Bootloader and a Host Application example for the AVR-DA family


Languages

Language:Makefile 44.1%Language:C 42.0%Language:Python 7.9%Language:Shell 3.0%Language:Assembly 2.9%Language:Batchfile 0.2%