Programming the XMEGA with an ISP

14,629

Programming the XMEGA with an ISP
Programming the XMEGA with an ISP

Atmel's XMEGA series of microcontrollers are compact devices featuring a high-speed clock, extensive I/O options, USB connectivity, and up to 8 UART ports. They serve as an effective intermediary between AVR and PIC microcontrollers and the more powerful ARM chips emerging in the market. However, XMEGA microcontrollers do not utilize the widely used ISP programming header found on most AVR development boards, making programming challenging. A solution was developed by a contributor in Poland, who created a straightforward method to program these chips using existing programming hardware. This design involves a few resistors and diodes to connect a USBASP to the XMEGA's PDI interface. On the software side, the contributor modified the USBASP firmware to support PDI device programming and provided a patch for AVRdude to facilitate firmware uploads via the command line.

In another project, an ATtiny85-based EEPROM programmer was designed. This project, initiated by an individual named Quinn Dunki, aimed to create a custom specification using available tools. The ATtinyISP USB programmer transmits data to an ATtiny85, which then programs an EEPROM chip with that data. This hardware is intended for a module in Quinn's Veronica 6502 computer build, which aims to add persistent storage for the operating firmware in the form of an EEPROM. Utilizing ISP and an ATtiny as an intermediary allows for easy reflashing of the operating system without the need to remove the chip. However, the design of the interface is critical, as issues with erroneous data writing were encountered during development.

Additionally, a new AVR programmer known as the MkII Slim has been introduced. This compact design incorporates just three components: a voltage regulator, a MAX3002 level converter, and an Atmel AT90USB162 microcontroller, which features an integrated USB module, eliminating the necessity for a separate FTDI chip. The firmware is based on the Lightweight USB Framework for AVRs (LUFA), a USB stack originally known as MyUSB, developed by Dean Camera. The MkII Slim programmer encompasses all essential features expected of an In-System Programmer, including jumper-selectable power options and compatibility with targets operating at both 3.3V and 5V. The bootloader on the microcontroller allows for easy reflashing with future updates. The complete development package, including code and artwork, is available for download.

For those seeking a smaller alternative to the Arduino platform, Scott has explored the ATtiny microcontrollers for smaller projects. His motivation was reignited upon discovering the Arduino-Tiny project, which provides a limited Arduino IDE for the ATtiny series. He found this project beneficial and has created a tutorial to guide users through the process of getting started with programming ATtiny microcontrollers under Linux.

The information provided outlines various innovative approaches to programming microcontrollers, showcasing the adaptability and creativity present in the electronics community. These projects highlight the importance of leveraging existing resources and developing custom solutions to meet specific needs in microcontroller programming and integration.Atmel`s XMEGA series of microcontrollers are neat little pieces of hardware; with a very fast clock, a ton of IO, USB, and up to 8 UART ports, these neat little chips serve as a nice bridge between AVRs and PICs and the very powerful ARM chips coming out on the market. Unfortunately, the XMEGAs don`t use the extremely common ISP programming header found on just about every AVR dev board making them a bear to program. [Szu] over in Poland came up with a very easy way to program these chips, all while using the programming hardware you already have on hand. [Szu]s build uses a few resistors and diodes to break out a USBASP connection to the XMEGA`s PDI interface.

On the software side of things, [Szu] wrote an update to the USBASP firmware to allow it to program PDI devices, and also has a patch for AVRdude to allow uploading firmware from the command line. Behold this ATtiny85 based EEPROM programmer. It seems like a roundabout way of doing things, but [Quinn Dunki] wanted to build to her specifications using tools she had on hand.

What she came up with is an ATtinyISP USB programmer, pushing data to an ATtiny85, which then programs an EEPROM chip with said data. The hardware is the next module for her Veronica 6502 computer build. When we last saw that project [Quinn] was planning to add persistent storage for the operating firmware.

This will be in the form of an EEPROM programmed with this device. Using ISP and anATtiny as a go-between means that she should have no problems reflashing the OS without removing the chip. But it all depends on how she designs the interface. For example, she blew a whole bunch of time troubleshooting the device because garbage data was being written to the chip.

In the end, having her manual bus programmer hooked up during the flashing operation was the culprit. Lesson learned, it`s onward and upward with the build. We`ve been featuring [Quinn`s] projects a lot lately. That`s in part because they`re really interesting, but also because she does such a great job of documenting her exerpience.

Here`s a new option for building your own AVR programmer. It`s called the MkII Slim and the diminutive size makes it live up to its name. The design is rather spartan, using just three chips; a voltage regulator, a MAX3002 level converter, and an Atmel AT90USB162 as the main microcontroller. This chip has a built-in USB module, foregoing the need for a separate FTDI chip. The firmware is built on the Lightweight USB Framework for AVRs (LUFA). This is a USB stack implementation originally called MyUSB that was developed by [Dean Camera]. Regular lurkers over at the AVRfreaks forums will recognize [Dean`s] name, or his handle [abcminiuser] as a source for many of the high quality AVR tutorials found there.

But we digress. The programmer offers all the features you`d want in an In-System Programmer. It can easily be reflashed with future updates thanks to the bootloader running on the chip. There`s jumper-selectable power options, and it can program targets running at 3. 3V or 5v. The full development package including code andartworkis available for download at the site linked above. For your convenience we`ve embedded the schematic after the break. [Scott] is a big fan of the Arduino platform, and he`s not afraid to admit it. It does all the things he needs, but now and again he would like to use something a bit smaller, without all the bells and whistles the Arduino has to offer.

He contemplated using an ATtiny for smaller projects, but after looking into what he would need to program the chip under Linux, he could never find the motivation to give it a go. That all changed when he discovered the Arduino-Tiny project, which aims to bring a limited Arduino IDE to the ATtiny line of microcontrollers.

He found the project to be quite useful, sohe put together a brief tutorial that walks through everything you need to get started. The tutorial is fair 🔗 External reference