Open Source XMEGA PDI Programmer!
Over the last week, I’ve been implementing what might be the world’s first *open source* XMEGA PDI programmer, thanks to a generous loaner XPLAIN board from Ross McKenzie (a fellow AVRFreak) and a lot of PDI related assistance from Justin Mattair. The programmer is now in a working beta release, available either as a prebuilt HEX for the XPLAIN board (see here) or as source code via the LUFA SVN.
The PDI programmer is part of the LUFA AVRISP MKII project, located in Projects/AVRISP of the LUFA codebase. From the latest AVRStudio4 release the official AVRISP-MKII supports XMEGA PDI programming mode, which means that I’ve been able to add it to my open source clone firmware too. It’s been a lot of work and taken many late nights, but it’s now ready for public consumption. It is able to program the complete XMEGA family of AVRs via any of the USB AVRs, as well as the normal AVRs via ISP mode. Both PDI and ISP modes can be selectively removed to save on compile space, allowing the programmer firmware to fit into even the 8KB USB AVRs (but 16KB is recommended).
Two pinouts are supported; a faster hardware USART mode which breaks compatibility with the official AVRISP-MKII pinout, but is very fast, and a slower bit-banged USART mode which is quite slow, but follows the official device’s pinout exactly. When compiled for the XPLAIN board, ISP mode is automatically removed and the hardware USART enabled for the fastest possible programming experience.
Note that AVRDude 5.8 is currently broken, and won’t work with my (or the official) AVRISP-MKII – you’ll need to download the AVRDude source and apply this patch until a newer release becomes available.
Have a Merry Christmas every one, and I hope this will lead to many new XPLAIN related projects in the future, now that everyone can program them easily without an external programmer! Look out for a new LUFA release soon.

WOW. I am not sure how I missed this for so long. I have been really looking for a OS PDI programmer for the XMEGAS.
Do you have any updates for this post?
Thanks!
Ril3y
Not all that much – latest code’s in the official LUFA 100219 release, and the avrdude bug has been patched (I believe) in the avrdude 9.10 release. Hope you find it useful!
- Dean