AVR Dragon ISP Problems

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

I just bought a dragon from digi-key and plugged it in, windows installed the drivers automatically and it shows one green and one red led. I load AVR Studio and choose the dragon and USB and hit connect and the dragon flashes green then the green light stays on.

I connected it to my AVR-Ready board and load the programmer. It finds the dragon and loads the ISP parameters fine and reads VTarget as 4.8V

I cannot however read the device signature or anything else. Says ISP Mode Error and Entering Programming mode... Error

I have tried it on a mega16 and mega164 and every usb port including a powered hub and it wont work. Is their a step im missing? I am going to put a zif socket on eventually but ISP should work.

I have metered from the leads of the avr to the isp socket on the dragon and all the pins goto the right places based off the dragons manual.

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

As I recall the ISP frequency is set pretty high on the dragons from the factory . Set the ISP frequency to 125KHz (good for default clocks on new chips) and also "write" it.

Duck

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

I have tried all of the ISP frequency's from 8MHz to 51Hz and they all take when I "write" it but I get the same entering program mode failed on every setting

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

Ok -I see that board has a 10 pin ISP connection where the dragon has a 6 pin connector so you probably have an error in your hookup between them.

I made up a 6 pin to 10 pin adapter for this kind of problem just using some veroboard and some male headers like those found on the dragon and hooking up the correct wires.

Duck

Attachment(s): 

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

I have metered from the leads of the avr to the isp socket on the dragon and all the pins goto the right places based off the dragons manual.

My old serial programmer had a 10-6pin adapter im using. Ill try again with separate F/F jumper wires but I metered between the pic and dragon and all the pins are where they should be.

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

Just make sure to set the ISP freq to 125KHz since that is a pretty good setting.

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

I am guessing.
Is the chip in the correct socket? No bent pins?
Is the oscillator working?

It all starts with a mental vision.

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

What is the led connected to?
Keep the ISP lead as short as possible, they seem pretty long. The Dragon is happier with a max of about 200mm or shorter.

Edit your drawing looks nothing like your wiring to me.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Mon. Oct 12, 2009 - 11:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just in case you were not aware,
the 10 pin connector on the Dragon is not a 10 pin ISP header. It is a 10 pin JTAG connector.
So you cannot directly use a 10 pin cable to connect a targets 10 pin ISP connector to the Dragons 10 pin header.

However, because the pins for JTAG and ISP are shared on the Dragon, all the needed ISP pins are available on the Dragon's 10 pin JTAG header when using the Dragon in ISP mode.

So to use a targets 10 pin ISP header, you will have to make an adapter.
Either a 6 pin ISP to 10 pin ISP or
a 10 pin JTAG to 10 pin ISP.

To map the signals from the 10 pin
JTAG connector to ISP:

JTAG    ISP
-------------
TCK     SCK
TDO     MISO
Vtref   VCC
nSRST   RESET
TDI     MOSI

--- bill

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

Im well aware that the ISP and JTAG pins are different and stated twice that I have used a continuity tester to verify the pinouts between the AVR chip leads themselves to the connection directly on the dragon.

I have taken A picture to show what im talking about. The AVR-Ready board is a nice carrier and has a Hex Inverter/Buffer on the clock to produce a very clean and accurate clock signal. I know my mega164 is working as I am getting clock output on PB1 as from a previous successful fuse setting. And I know for sure that the mega164 has ISP enabled as I only turned off the brownout detect and the watchdog fuses and set the device for my 8mhz external clock.

The multi colored cable is from my ISP mkI which came stock with a 10pin header and had a 10-6pin adapter I am now using that in reverse to turn the 6pin ISP off the dragon into the 10pin for my board. All the pins are correct. The cable length is 220mm long and I am using a 3ft usb cable to connect directly to the onboard usb of my pc's motherboard.

I have tried again with short 100mm F/F pin headers and a 125KHz clock but their is no difference. I wish I had another computer to try it out on as im putting my money on it being a stupid windows issue. My pic programmer, usb-2-serial device, and all other usb devices are working fine though so its strange.

A09-0062/09 is on a sticker and A08-0396D is on the silkscreen. Im assuming the silkscreen was the original version and its been updated to a newer firmware, Do I need to update the device manually or something?

Attachment(s): 

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

A couple of things you might try.
There is a Dragon upgrade option under [Tools] that will update it to the latest firmware if you haven't already done that.

Not sure I'd want to run the dragon board on top of anti-static foam. Some of those are conductive.

You could try the Dragon with avrdude.
It can be run with some debug options to provide more information as to what is going on.

I've not used the Dragon with Studio other than to upgrade its firmware. I use it with avrdude. I have used avrdude with it on Vista, XP, and Linux and didn't have any issue, but I'm using it directly connected to m328p, and attiny85s.

--- bill

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

Am I the only one worried about that photograph? Could you make the ISP lines any longer I wonder? If you really need a 6 to 10 converter make it about 10-20mm long (if that)

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

Photograph: are you sure that the black foam under the Dragon-board is non-conductive ? :!:

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Quote:
The AVR-Ready board is a nice carrier and has a Hex Inverter/Buffer on the clock
Alarm bells ringing..you mean you have 2 of them in series so as NOT to invert the clock.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Hey, Ok I have done alot of trying with different things but still it wont work...

js - Yes the buffer is doubled, I did not design the board so im very sure it works perfectly, I have a bunch of mikroe stuff and its all top notch.

Plons - Yes running it on foam is not a good idea, I need to go buy a case as I have had an AVR crack due to a short with a little wire clipping on my bench..

clawson - I re-pinned the multi colored cable so I could use it as a direct connection between my AVR-Ready and the dragon, now the programming cable is only 100mm long.

bperrybap - I upgraded the dragon via avr studio and it still wont work. I loaded up avrdude and typed:

Quote:
avrdude -p m164p -c dragon_isp -P usb -v

avrdude: Version 5.6 ............
Config file is "c:\winavr\bin\avrdude.conf"

Using Port : usb
Using Programmer : dragon_isp
avrdude: usbdev_open(): did not fine any USB device "usb"

That's a problem as the Jungo driver is loaded and the dragon driver version is 10.1.1.0. I tried re-installing the avr studio usb driver as well.

In AVR Studio the dragon can read the boards voltage so studio can communicate with the dragon but im not sure what im missing in avrdude anyone know the proper windows xp command?

I also tried on a laptop with a 750mA powered hub with a fresh install of winavr and avr studio and I get the exact same behavior and errors.

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

Well, as you were able to upgrade the dragon I'd say it is not a USB communication problem.

I just did a quick continuity test on the foam and depending on how close together you stick the probes in the foam, you get resistances as low as 3-4k ohms.
And if you look at the board, you will see
that pretty much the only thing sticking up/down that isn't masked are the pins for the ISP, JTAG and Power header pins.

So my guess is that running the dragon while on the foam may cause all sorts of strange problems.

See this thread for a discussion about libusb vs Jungo:
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=408865

If you want to build your own compact case,
I wrote up an instructable on how to build a case for it:
http://www.instructables.com/id/A-protective-case-for-the-Atmel-AVR-Dragon/

--- bill

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

bperrybap - I do not run the dragon on the foam, I put it back in its box after trying to use it and when I take it out I pull the foam by habit. I don't use it until I have wiped off my bench.

I didn't know the foam was that conductive though so I will defiantly keep that in mind.

I will try the driver method in that thread tomorrow, thanks for the link.

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

Ok so I decided to take the AVR-Ready board out of the picture, put the mega on a breadboard and stuck in a header and wired up the dragon. The mega is powered by the dragon and wired as per the spec sheet. I would have soldered in headers and a 40pin ic socket but if the dragon has a problem I wouldn't be able to return it then.

I attached a picture so you can see everything is right, the header pins look all skewed and close but in reality their very stable and even squeezing two together wont make them touch.

In AVR Studio 4.17 the programming tool reads 5V on VTarget, Hardware Rev: 0x107 Firmware Version: 0x101200 I can set ISP freq and it says setting its OK but reading signature, programming, fuses all give the Entering Programming Mode... FAILED! error.

------------------------------

I decided to try the lubusb filtered driver as per bperrybap's post and replacing the AVR Studio driver caused avrdude and Studio to not detect the dragon at all. I re-installed Studios driver and libusb and now Studio has the same behavior as before but avrdude works!!! kinda...

Avrdude detects the dragon and the device, voltage, clock and all that but this is the new error:

Quote:
avrdude: stk500v2_command(): command failed
avrdude: unsupported encapsulated ISP command: 0xd
avrdude: jtagmkII_recv():
avrdude: usb_fill_buf(): usb_bulk_read() error usb_reap: timeout error
avrdude: jtagmkII_recv(): Timeout receiving packet
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: stk500v2_program_enable(): bad STK600 connection status: Unknown (0x64)
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

I have attached the -vvvv dump from avrdude but im not sure what to do now. I have tried writing a flash file, erasing the device, everything causes that error to come up.

I have tried with avrdude 5.3/5.5/5.6 and have not found a windows binary of 5.8 to try it with yet.

Attachment(s): 

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

Add decoupling capacitors on the breadboard.
Connect all Groundpins to ground, and all Vcc pins (including AVcc) to the 5V from the dragon.

Next: set ISP-speed to 100 kHz, and click the Write-button !!!

Then it will probably work (if there are no shorts :S )

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

I'm wondering what was done to the mega164 since the OP has stated (not until the fourth post of his)that he has been programming it. At first I thought he couldn't get it going in the first place.

Quote:

I know my mega164 is working as I am getting clock output on PB1 as from a previous successful fuse setting. And I know for sure that the mega164 has ISP enabled as I only turned off the brownout detect and the watchdog fuses and set the device for my 8mhz external clock.

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

Plons - I connected all to GND to ground and AVCC to dragon vcc and added a small decoupler cap but it does nothing in studio or avrdude. I was connecting it to emulate a zif socket like I want to put on the dragon and as with a zif none of the other pins are to gnd or vcc so I see no reason they would be needed.

digitool - I originaly had a knockoff avrisp mkI but its usb-2-serial chip was flakie and finally became useless. I know the 164 is good as right now I have an old program running on it and I can scope the pins and see my old serial output.

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

Ok so I decided to give jtag a try, never used it before so I wired it up on the breadboard and IT WORKS!! Both avrdude and Studio work.

I have verified by playing with the CKDIV8 and CKOUT fuses and I know the programming is taking. I also loaded a program, read the flash and verified it wrote as expected.

I wrote the default fuses from the datasheet 0xFF 0x99 0x62 and am using the chip on the breadboard with just an LED on PD7 to verify things work.

Here is a new wonderful problem, I cant make ANY of my old programs run! I even tried this bloody simple one and it does nothing.

#include 
#include 


void main()
{
	DDRD = 0xFF;    //All output
	PORTD = 0xFF;   //All segments off


  while(1)
  {
	  PORTD = 0x00;
		_delay_ms(50);
		PORTD = 0xFF
		_delay_ms(50);
  }
}

I have the clock, device, and optimizer project settings good (I have tried -00 and -0s) but I can not make any pin on any port change state. Now I haven't actually programmed an AVR for over a year due to my avrisp mkI dieing on me but I really didn't think I forgot this much...

Can you recommend a piece of code to toggle a pin and the correct fuse settings if mine are not alright so I can put my scope on it and make sure the damn thing works.... Hopefully I didn't damage my chip with the week of trying to get the dragon working...

Also any ideas to why jtag works great and ISP completely fails? Im using the same wires and hookup method so only thing I can see is maybe a trace is damaged to the ISP 6pin plug or something?

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

Well since you have JTAG working then you can look inside the chip in debug mode.

You can change individual port bits, single step etc.

Do you have Studio installed?

Quote:
with just an LED on PD7
And a series resistor I hope.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js - YAY! I don't know what I did, I took a break and booted the computer and now debug and programming via JTAG is working very nicely. I think things just needed to be restarted after I had changed so many settings.

I doubt if ISP is working yet though, Im going to make a carrier board for the chip with ISP 6pin and JTAG 10pin on either side to make things easier as I don't plan on ordering a ZIF for a while yet. I will make the board up and report back if ISP is working.

Thanks for all the help! Hopefully im lucky tomorrow.

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

Hello,

Well after many hours of tinkering I now have a carrier board for my mega with ISP and JTAG headers with their respective cables. Im going to go buy a case for it when I make my mouser order.

Dragon works perfectly and all my windows issues have been solved, I can program in ISP and JTAG in avrdude and studio!

I have a feeling my problems where windows meddling with the usp stream (fixed with libusb filtered + keep studios usb driver) and with grounding issues. The dragon is INSANELY sensitive to any form of static or ground in the end I made a pcb with my headers and a DIL40 ic socket and coated it with an anti-conductive silicone sealant from my electronics store.

----------------------------------

To sum up the thread if anyone has the same problem as me I recommend you do these things:

1) Clean off the dragon and put it in a sealed case, put it on an insulating material and do NOT touch it when its on.

2) If ISP/JTAG is not working stick the mega in a breadboard and manually pin out the connections as per specsheet. (mine worked on breadboard but not pcb's)

3) Draw a diagram of how you pinned it out on the breadboard and re-pin your programming cable to mach.

4) If using JTAG pin #10 cannot be connected to GND on your target if it is at the same potential as pin #2 JTAG will not detect the target! Pins 7/8/10 are NOT connected.

5) If using a ZIF I recommend you buy these headers you can re-pin them easily and they help alot. Or make little boards with the pinouts you require but that's like 2-8 boards, I just re-pin my headers.

Thanks for all the posts guys!