Has anyone written an PDI programmer for the ATXMEGA32A4U on an Arduino?

I've ordered a ATXMEGA32A4U and am wondering about how to program the blasted thing.

Apparently it uses a "PDI programming interface" which I don't think I have, or if I do have it, I don't know what it looks like.

So I thought it might be useful to turn an Arduino into a PDI programmer. Has anyone done that already? If so, any tips?

Also, is there a "hardware" interface for it yet? "pins_arduino.c", that sort of thing.

Maybe you've seen this:
http://fourwalledcubicle.com/blog/2009/12/open-source-xmega-pdi-programmer/

I just received mine from LadyAda. They have a great website about it.

http://ladyada.net/products/atmega32u4breakout/

And their Wiki:

http://www.ladyada.net/wiki/products/atmega32u4breakout/index.html?rev=1302835337

atmega32u4 is not the same as xmega32A4u !

But the USB Atmegas are what the LUFA PDI programmer runs on. Same processor as on the Leonardo, too, plus all the pins are broken out for use.

Thanks for your answers everyone. :slight_smile:

I had seen that page, thanks Jack.

The Teensy page is interesting but links to a description of a pre-installed bootloader. I was interested in how to program the thing if it had no bootloader for some reason. Or just to discover its device signature.

The LadaAda page is also interesting. I hadn't spotted that one. :slight_smile:

From what I have been able to gather so far the low-level programming uses two pins (Reset and PDI_DATA) where you basically shove serial data (8 data bits, 1 stop bit, even parity) through those two pins using Reset as clock and PDI_DATA as both Tx and Rx using two x 220R resistors to allow communications both ways.

It seems that you follow a fairly specific timed protocol of sending stuff down the reset pin, and then 0x1289AB45CDD888FF (lol) to enter external programming mode.

Nick,

I recently discovered that all the signature bytes for the Atmel CPUs are listed in the CPU data sheets available on their web sites (search the PDF for "signature"). I have not found a consolidated list anywhere, but here are the ones relevant for this thread:

Device Device ID bytes 2 1 0
ATxmega16A4U 41 94 1E
ATxmega32A4U 41 95 1E
ATxmega64A4U 46 96 1E
ATxmega128A4U 46 97 1E

They all agree with the codes listed in your board programming software :slight_smile:

Thanks for that Marco. Now the next trick is to get the hardware to "talk" PDI protocol. And get the actual chip to hand as well, of course. :slight_smile:

Hi Nick

I've just received some ATxMegas, and at the minute the only reaction I get from them is when I poke them with a stick. And that's not too exciting...

Just wondering if you ever managed to turn an UNO into a PDI programmer as I haven't found much info on using this things in an Arduino environment

Ta

Iain