Some time ago, as part of a customer project, it was necessary to modify the Arduino IDE to compile for (and flash) a device that was originally based on an ATmega328 processor, and used the Arduino IDE to compile and flash the device. The original prototype, of course, used an actual Arduino, and the next step was to produce a circuit board with the ATmega328 CPU. The subsequent step was to IMPROVE the CPU.
this processor was chosen because a) it had a 32Mhz clock, b) it was compatible with the 3.3v board, c) it has twice the NVRAM for code, d) it has the additional I/O pins that were needed for the project, e) it uses a TQFP44 package which fit nicely on the board, and f) the avr processor is code-compatible, though the registers and I/O are obviously not (which means the 'cores' and 'variants' code had to change).
So to be able to retain the SAME code, I produced a set of 'core' and 'variant' files for xmega, as well as updating the FreeBSD, Debian Wheezy, and Ubuntu 12.04 avr packages to handle the ATxmega64D4 processor.
All of these files, including source, are available here:
It includes a bootloader that was derived from the standard Arduino bootloader (the original one) that's tailored for the ATxmega64D4. You could modify this for a different processor if you like, or add features. The license is GPLv2 or later, just like the ATmega version in the Arduino IDE. It lets you flash via the same serial protocol used by the Uno.
I also solved the problem of making 'analogRead()' work the SAME WAY as it does for the ATmega328 . You're welcome.
The web site includes a short description of an inexpensive prototype board for the CPU, and the basic process I had to go through to get it to work, as well as a description of how to include it into the Arduino IDE (patching boards.txt, patching avrdude.conf, symbolic links in the 'cores' and 'variants' directories pointing to the new code).
(There is no update for WinAVR, but you could try using the FreeBSD patches to update and build under Cygwin)
Just worthy of pointing out, there are a small number of Xmega boards, one of which has its own clone of the Arduino IDE. I didn't think it was necessary to clone and maintain THE! ENTIRE! PROJECT! like that, so I'd rather work WITH the installed Arduino IDE and just fix things with patches, then submit the fixes to maintainers. The less custom coding, the better.
I'd REALLY like to see an Arduino that uses the xmega, preferably NOT just an 'A series'. The header file I provide for 'variants' has an 'ascii art' description of a reasonable board layout, with pin mappings. Maybe someone could do a board for that, get the necessary gummint testing approval (CE, FCC) and sell it as a new type of Arduino?