Using an AVR Dragon with ISP headers

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

So, I've been reading the Dragon docs, and I've been reading threads, and I clearly don't know *something* but I don't know what it is that I don't know.

 

I found an AVR Dragon lying around and thought "hey i could use that". Well, sort of. If I power an Arduino externally, and connect the dragon's ISP header to it, it works -- I can use avrdude with the "dragon_isp" programmer, and it can see the atmega328p and confirm the chip bits.

 

I have other boards, plural, with ISP headers and sockets for various atmel chips. All of them have been successfully used with those chips and the ISP headers from my sparkfun usbtiny-alike programmer. If I connect the dragon to them, it fails weirdly -- it reports a chip ID of either 0x000000 or occasionally 0x003f00, and fails. Yes, I am aware that the VCC pin is actually a VTG pin, and I'm supposed to be supplying power to the target directly. The documentation seems to suggest that I want to do one of several things:

 

1. Power external board directly through something else. Connect the VCC pin of its header to the VTG pin on the Dragon so the dragon's level shifters can do their magic.

2. Power external board from dragon. Connect one VCC pin from dragon to VTG pin on dragon, and another VCC pin on dragon to some voltage input on target board.

 

Neither of these works, with any of the several boards in question. In each case, if I use the same board with a different programmer's ISP headers (which usually just provide power directly from VCC), it seems to work fine.

 

What obvious things might I be missing? Everything involved is 5V. (attiny84, attiny85, atmega328p.) The other programmers I've tried are the built-in one on the Arduino Uno, and a sparkfun USB tiny clone.

This topic has a solution.
Last Edited: Thu. Nov 5, 2020 - 02:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the_real_seebs wrote:
What obvious things might I be missing?
Inductance, series termination

Keep the target cable as short as possible or within reason, a bit of resistance can make a closer impedance match between the AVR Dragon's drivers and the target cable

the_real_seebs wrote:
Everything involved is 5V.
Good; AVR Dragon's power supply has a design defect wrt USB VBUS.

 


AVR Dragon

AVR Dragon (web doc)

 

Dragon

...

March 2009: Disclosure on why the voltage Dragon's voltageregulator pops under certain circumstances

...

[2/3 page]

The DragonLair

 

Tiny AVR Programmer - PGM-11801 - SparkFun Electronics

 

"Dare to be naïve." - Buckminster Fuller

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

I've used my dragon for several years, both as a programmer and as a debugger.  It is best to power your target board externally, but by placing a jumper from the vcc header to the vtg pin you can power the target board, however, if the target draws too much current it will pop the regulator and slay the dragon!  So be warned. 

I use a 6 pin to 6 pin IDC ribbon cable about 6-8" long.  The dragon is a slow performer, both as a programmer and a debugger, but it was cheap in its day.

I have several, and at least one still works!  You would be better off using a USBasp as a programmer, its faster and cheaper to replace. 

Jim

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

From what you have said, I'd guess that you are trying to power the boards that do not 'work' from the dragon.

 

 You say that both boards which do not connect to the dragon can be programmed using other ISP based programmers so I would conclude that their ISP interfaces are wired correctly.  The dragon itself is powered from the USB interface so it should show a lit green LED when plugged into the USB port on your computer and a lit red LED when its driver connects successfully.

 

Connecting the VTC pin on the Dragon's output to the  target's VCC power should detect the target's voltage but will not power the target (in case you thought it might).  As Jim said, that takes a separate jumper from the Dragon's Vcc set of pins (header) to the target board.

 

I too have used the dragon to both program and debug both a ATmega328 and ATtiny84 but in both cases, I provided an independent voltage to the targets. So I'm not sure why your option 1 does not work.  

 

You have not mentioned CPU speed but just in case, try using 57600 BAUD  between the dragon and computer as in "avrdude -pt84 -cdragon_isp -b57600 -u -Uhfuse:w:0xDf:m" (in this case changes the DWEN fuse so don't copy and paste).

 

Alan

 

Edit: fix grammar

Last Edited: Wed. Nov 4, 2020 - 01:16 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, I hooked this up to a scope and stared at it. One thing I learned: Looking at the SCK signal from the usbtiny makes me AWED that it ever worked. Wow. That is a horrible signal.

 

Anyway, I noticed in passing that, gosh, the SCK clocks sure are really fast (0.5us). And then I read, in the avrdude man page, a side note that the dragon's default bitclock is "fast" and you may need to use -B bitclock to slow it down.

 

Sure enough: Set bitclock to 5us, instead of its default of about half a microsecond, and suddenly everything works with my expansion board as-is.

 

(And yes, I did figure out that I needed to run VCC to them separately from handling the VTG header, but thanks for the clear explanation.)

 

Last Edited: Wed. Nov 4, 2020 - 11:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

please mark your solution as the solution to your problem, that way other people reading on your problem will know it has a solution.

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

It finally occurred to me how obvious this is:

 

The Arduino is a chip with a 16MHz crystal and no CLKDIV. The attiny84 is factory-default 8MHz onboard oscillator and /8 CLKDIV. So it's running at *1MHz*, and the Dragon is trying to send it half-microsecond pulses of SCK. I suspect the SPI hardware is at least slightly limited by the clock speed. So that is why the "externally powered Arduino" worked -- because 16MHz clock is fast enough to keep up with the Dragon's default SPI timing.