Easy hack to allow an AVR Dragon to power the target device over the ISP cable

TL;DR: You can power a target device from an AVR Dragon over an ISP header by adding a jumper wire from the VCC pin to pin #2 on the header that you are *not* using.

I’ve been a big fan of the SparkFun Pocket AVR programmer, partly because it has a handy little switch that lets you send power to the target device…

Pocket AVR Switch

Unfortunately, I started getting “Error: Could not find USBtiny device” while programming boards using a jig

The programmer would randomly disconnect from the computer, and I had to unplug and replug the USB cable each time to get it back online. This was a big hassle and increased the average cycle time from 3 seconds to 10+ seconds.

It seems like the problem goes away when I wear a grounded bracelet,  so I think the Pocket Programmer is sensitive to static discharge on the ground pin. My jig exacerbated the problem because it is designed so your fingers touch the grounded top surface before each insertion.

It would be nice to use a more robust programmer for a job like this. Atmel’s AVR Dragon is a very nice board, except that it explicitly does not have an option to power the target though the programming cable. People have come up with ingenious ways to inject power into that cable, but I wanted something simple and fast.

Luckily, the Dragon board has two different programming headers and their pins are wired together. This makes it possible to grab power from the nearby VCC pin and connect it to the Vref pin on the unused header. By sending power into one header’s power pin, it comes out on the other.

If you want to program using the 10-pin header, then you would connect a Vcc pin to pin #2 on the 6-pin header.

ten pin connections

If you want to program using the 6-pin ISP header, then you would connect a Vcc pin to to pin #4 (corrected!) on the 10-pin header…

ten pin connections

That’s it! Here is what it looks like in real life for a 6-pin ISP cable…

wpid-20141212_122136-1.jpg

You can check that it worked by reading the Vcc voltage from the Device Programming dialog in AtmelStudio. It should read 5 volts even with nothing connected to the cable…

5 volts

UPDATED 12/12/2014 – I totally got the pin on the 10 pin JTAG header wrong. Vref is pin #4 NOT pin #2. Corrected now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s