[TUT][HARD] Programming an external xmega with an XPLAIN

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is possible to convert a XPLAIN board so that it can program external xmega devices as a PDI programmer similar to AVRISP mkII.

You will need an XPLAIN board and follow the instructions in Dean Camera's excellent LUFA XPLAIN Bridge blog to convert the XPLAIN into an AVRISP mkII clone:

http://www.fourwalledcubicle.com/XPLAIN.php

http://fourwalledcubicle.com/blog/2010/02/mein-server/

This creates an AVRISP mkII clone that can be used to program the onboard xmega128. I wondered whether this could be modified to program an external xmega chip instead of the internal one...

AFAICS this isn't quite as straight forward as it sounds. Either the reset or the data line has to be isolated from the on-board xmega128, and in the case of reset this has to be pulled low on the xmega128 only. Unfortunately the routing of the reset signal seems to go from the USB chip to the xmega128, then to the connector J100 (XMEGA_RESET_PDI_CLK) making isolation difficult.

However, the data line (XMEGA_PDI_DATA) actually has a pair of resistors R203 and R205 in the line near the USB chip, so it seems this can be relatively easily isolated by removing the resistors and replacing them to isolate the two common pads. A wire would then be taken from the common side of the resistors to the data line of the external board. The reset and ground can be taken from J100.

I can confirm that isolating the data line by removing and replacing R203 and R205 works, I now have a makeshift external xmega PDI programmer! Note that the external board has to be 3.3V for this to work (i.e. same voltage as the XPLAIN board).

What I did was find R203 and R205 on the XPLAIN PCB, these are together near the USB chip and crystal, just above the test point marked PR0. If you are unsure buzz it out with a multimeter, you should find the two common pads that connect to the data line J100 pin 8. I removed these resistors (220R) and replaced them pointing the other way in a "˜V' shape so as to isolate the two common pads. I then connected a small wire from the tip of the "˜V' (i.e. where the two resistors connect) and wired to the unconnected spare pin on the USB JTAG connector (J200 pin 8 ).

I've used a standard 6 pin PDI header on my external board labelled P1, so I connected the following pins between the boards using jumper cables:

J200 pin 8 to P1 pin 1 (data)
J100 pin 6 to P1 pin 5 (reset#/clk)
J100 pin 10 to P1 pin 6 (gnd)

My external board is powered separately so didn't use the 3.3V on the XPLAIN board to power my external board. Due to the substrate diodes this has the effect of pulling reset low when the external board is powered down, but as soon as power is applied the xplain board recovers.

To convert back to to an internal programmer all you need to do is jumper J200 pin 8 to J100 pin 8, i.e. reconnect the data line back to the internal xmega128.

Mark.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I apologise for the 'cross post' in the AVRStudio forum. It wasn't intended as a cross post, mearly an announcement and a cross reference to something may exist in another (in this case more general) forum that people that have subscribed to the AVRStudio forum but not necessarily subscribed to the other forum might find useful. I understand the problems of multiple threads on the same topic in different forums and your decision to lock it.

As an aside it would be quite useful to have a mechanism to do this (maybe a specific 'announce' type post that is immediately locked to prevent replies to it?).

Mark.