How to program ATXMEGA384C3 and burn Arudino bootloader - Page 1
Forum section: electronics / general

author: aiq25
author_rank: Regular Contributor
timestamp: November 16, 2020, 05:53:33 pm
content: Hi. I was looking to burn the Xmegaduino bootloader on a ATXMEGA384C3 MCU. I understand that Xmegaduino doesn't officially/fully support ATXMEGA384C3 but it seems possible (based on posts below).https://github.com/Xmegaduino/Xmegaduino/issues/36https://github.com/Xmegaduino/Xmegaduino/issues/44I think for the initial flashing of these IC's I will need a PDI programmer, is this correct? I don't have any Atmel programmers available but I'm willing to purchase one to get it going but it would be great if someone can give some tips.I'm trying to develop a breakout and development board based on the ATXMEGA384C3 MCU. This is intended purely for learning purposes and as such I think it will be great to use the Arduino bootloader on it. Eventually I might go with something else.

author: westfw
author_rank: Super Contributor
timestamp: November 17, 2020, 01:07:01 am
content: I'm not seeing any bootloader source code for Xmega in there. There are directories for building bootloaders, but the makefiles point off to other directories that don't exist.Perhaps it's trying to use a LUFA bootloader (which normally has to be downloaded separately, due to the licensing issues.)Are you looking for a USB bootloader or a serial bootloader?

author: aiq25
author_rank: Regular Contributor
timestamp: November 17, 2020, 01:12:45 pm
content: Quote from: westfw on November 17, 2020, 01:07:01 amI haven't looked through the files, I just assumed it was there. I will have to take a thorough look if I can find something. Thanks for pointing it out.QuoteWhat is the difference between the two? I assume by serial you mean the board will communicate via serial communication? I think that might be best.

author: westfw
author_rank: Super Contributor
timestamp: November 18, 2020, 12:31:31 am
content: QuoteSerial bootloading would require that you have access to one of the UART ports, and some sort of serial adapter to your PC. Arduino Uno and Nano have serial bootloaders, and a second chip to do the USB to serial conversion.USB Bootloading requires a connection to the USB port of the microcontroller (and requires that it HAVE native USB support.) USB bootloaders tend to be bigger and more complex than serial bootloaders, and they have their own set of "issues." But fewer chips! The Arduino Leonardo, and pretty much all of the SAM-based arduinos, have USB bootloaders. (For SAM, Atmel has a vaguely standard USB bootloader protocol: SAMBA, and the SAM Arduinos use that, or a slightly modified version of it.)

author: aiq25
author_rank: Regular Contributor
timestamp: November 18, 2020, 10:41:46 pm
content: Quote from: westfw on November 18, 2020, 12:31:31 amThanks for the explanation. That's what I was thinking you meant. According to the ATXMEGA384C3 datasheet, it does have native USB support but I'm assuming no bootloader comes pre-flashed with these IC's so my best bet would be a serial bootloader for initial flashing. I'm not sure which programmer I should get at this point. I guess I will have to little bit more searching on this.

author: aiq25
author_rank: Regular Contributor
timestamp: November 19, 2020, 06:53:22 pm
content: I'm just going to comment this here, in case someone else in the future is looking for this:It looks like Microchip/Atmel does provide a USB DFU bootloader for the ATXMEGA384C3 MCU's. However, the IC's are not programmed by default at the factory. So for first time programming, an external programmer will have to be used. I'm thinking of getting an Atmel ICE but the price is a bit high for me right now, considering this is a hobby project.For anyone looking, the HEX file for the XMEGA bootloaders from Microchip can be found here:https://microchipsupport.force.com/s/article/Pre-Programmed-USB-bootloader-for-Mega-Xmega-devicesDFU Bootloader hex files for Xmega USB devices can be download from the following link:http://www.atmel.com/images/AVR1916.zipMore information on programming these MCU's can be found here:https://microchipsupport.force.com/s/article/Programming-AVR-XMEGA-devices-using-USB-peripheral