Dragon misbehaving

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

My AVR dragon seems to not be working correctly. It all start the other day. I was messing around with a 20x32 shift register driven LED with a attiny2313 using debug wire and everything was going fine at first, it was loading the program into the memory and everything. After a while however, it stopped working correctly. It would have trouble loading the program and entering debug wire. It would then give me a "avr dragon:usb connection skipped. Each instance of avr studio can only have one active USB device at a time." I read that this is a common error and tried restarting AVR studio which didn't seem to work. I then created a new project and that seemed to fix it.

So I continued debugging a couple times, and noticed that the program wasn't running correctly, it was randomly jumping out of loops to random spots in the program (at least that's what the yellow arrow told me when I stepped through). I've noticed this has happened before when my optimization was set at "Os" but I checked and it was set at lowest "O0." Then after restarting the debug cycle the thing would not work anymore. It wasn't the same however, this time it gave me the error "Unable to connect to device. This could be caused....." with neither option making it work (retry debugwire connection, use spi to enable debugwire interface). The avr dragon options are greyed out, so even if I wanted to disable debugwire it won't let me.

So I tried some other attiny2313s (I have like 3 others), ones which have never been programmed. The spi interface won't work, I can't enable debugwire, when I try to read the fuses or any of the ISP mode settings I get "A problem occured when executing the command, make sure that you are using the correct......" None of them can be programmed or configured.

Here are some things I tried, none of which resolved the issue. Created new project, restarting AVR, checking optimization level, verified target voltage of 5.4 V, tried setting ISP clock frequency really super low.

A couple more details, using AVR studio version 4.18 build 684, avr-gcc compiler "C:\WinAVR-20100110\bin\avr-gcc.exe", on Windows 7 professional x64.

Sorry for such a long post, but figured I'd give you the whole story so it might be easier to help me solve this. Not really sure what is going on...

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

How is the Dragon connected with the PC (direct or via a self-powered hub), is the PC connected to the mains with or without safetyground, how do you power the targetboad, hpw long are the leads between Dragon and targetboard, ....
In other words: it all depends.

Post a picture of your work setup. And a schematic.

Oh, and do you know how to get the Dragon out of dW-mode ?

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 will post a schematic and picture later when I get home but I can answer a couple of your questions now. The dragon used to be connected through a hub, but I thought that was causing the initial problem of it having trouble loading the program, so now it is plugged right into the back of my computer. The PC is connected to the wall with a safety ground. The target board is powered using a separate computer power supply (which also has a safety ground). The leads between the target board and dragon are like 8 inches.

I do know how to get out of dW mode, you just click the debug menu, then avr dragon options, then there is an option in there to disable debug wire. That's how I've always done it, but since the avr dragon options are greyed out (since they become ungreyed upon entering debug mode which I can't do) I can not try that.

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

Quote:
The target board is powered using a separate computer power supply
Good thing it is connected to safetyground as well. Are PC and this powersupply on the same wallwart or extension cord ?
Bad thing is that it's a computer power supply. With no load, the 5V can be 5.5V or even more. Since there is no fair current limit (30A is unfair for an AVR with a bunch of leds), you possibly blew the AVR and who knows, the Dragon.
If you really MUST use a PC PS, use the 12V, run that through a 7805 or alike, and use THAT 5V to power your AVR.

The Dragon: best is to run it of a powered hub (see the link in my signature)

On how to get out of dW-mode: I just needed to check.

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

Well I don't think it would be that individual chip, because like I said I tried a couple others and none worked. So I must have damaged something on the dragon board? The board itself still communicates with the PC, but not with the microcontroller. Can I send in a dragon for repair or should I just buy a new one? I bought it from digikey 2 months ago, don't know if I could send it back or not.

Yes the PC and the other PC power supply are on the same power strip.

What is the best stable power supply to use that is affordable?

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

Quote:
What is the best stable power supply to use that is affordable?
My suggestion is low cost:
Quote:
use the 12V, run that through a 7805 or alike, and use THAT 5V to power your AVR.

Btw, did you have a look at my Dragon-page ?

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

Yes I did, very helpful information! It's a good idea to do the whole buffer thing, I'll need to do that whenever I get a new one or fix this one. You did mention some repairs for certain things in there but I don't know if they apply to mine (as mine likely broke from over current in on the vtarget/vcc line. Should I just buy a new one? Oh and before my target voltage in AVR studio was showing 5.5V, now it shows 0.2 V :(.

Here are some pics of my setup:

The alleged culprit, my friend likes to call it medusa because of all the wires lol. I was actually originally using a usb charger to supply it but I new that wouldn't suffice when I powering the big LED array.

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

You could give it a try, the repair.
Also a search on this forum on fried dragons can be helpfull.

I see no decoupling capacitors on your breadboard: they are not optional but necessary.

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