AVR Dragon Programming Issues

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

I hope this wasn't covered before, but I'm having a few issues with my new AVR Dragon. I am able to connect to my target (ATMEGA32A), read the voltage, verify the signature, erase the Flash, etc.

However, programming seems a little flaky. Sometimes I can program and verify the Flash in one pass. Other times I have to program the Flash 2-3 times before I get no errors. I get errors at different locations in the Flash. Has anyone experienced this?

Also, I would like to debug my C code besides program the target. But, I don't seem to be able to in AVR Studio. Do I need to change the OCDEN fuse to enable this?

Thanks.

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

Quote:

Do I need to change the OCDEN fuse to enable this?

That depends on what the current value is. If you want to do on-chip debugging it needs to be enabled.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

How long are your ISP wires? Previous posts here suggest the Dragon has very poor drive and shorter cables (100mm or less) are preferred.

As an alternative you could always wire up the 32A to do JTAG rather than ISP which has the further advantage that you can then debug as well as program it.

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

clawson wrote:
How long are your ISP wires? Previous posts here suggest the Dragon has very poor drive and shorter cables (100mm or less) are preferred.

As an alternative you could always wire up the 32A to do JTAG rather than ISP which has the further advantage that you can then debug as well as program it.

The OCDEN fuse is off. I'll turn it on so I can try debugging in AVR Studio. Is debugging on the device like using the simulator in AVR Studio?

I'm using JTAG for programming since I want to debug also. The cable is about 5"-6" long.

Also, I'm using a 7.3728 MHz crystal. In the fuse settings, I selected "Ext Crystal/Resonator High Freq; Startup Time 16K CK + 64 ms". I set CKOPT. Is this correct?

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

Quote:

Is debugging on the device like using the simulator in AVR Studio?

Almost exactly like it except that what you see is totally accurate. You never have to worry about the OCDEN fuse - Studio handles that.

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

Okay, I programmed the OCDEN fuse and now I can debug the target.

Also, I borrowed a JTAGICE MKII from work and found no issues programming the Flash on the ATMEGA32. So, I have to assume there are issues with the AVR Dragon having enough drive strength. At least, I know it's not my design or PCB layout.

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

The JTAGICE-mkII will do both ISP and JTAG.
So should your Dragon.

If one works, and the other does not, I would suspect your Dragon settings. Is the ISP frequency too high? 125kHz should be fine.

Do you have inappropriate loading on the ISP pins? There should be nothing stronger than 10k pull-ups and no capacitors.

David.

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

david.prentice wrote:
The JTAGICE-mkII will do both ISP and JTAG.
So should your Dragon.

If one works, and the other does not, I would suspect your Dragon settings. Is the ISP frequency too high? 125kHz should be fine.

Do you have inappropriate loading on the ISP pins? There should be nothing stronger than 10k pull-ups and no capacitors.

David.

I tried to find the JTAG clock frequency setting in AVR Studio, but couldn't find it. Is there one? Where is it?

The JTAG pins are dedicated for JTAG. There is nothing on them. No components, no caps, no resistors.

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

AFIK, JTAG programming does not need a clock as such. i.e. TCK provides the necessary signal.

However JTAG debugging of a running program does need TCK to be within limits.
You will find this setting from within the Studio Debug menu.

David.

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

Another update. Last night I was having real issues programming the ATMEGA32. I had to do it like 15-20 before I would get no errors. Forget about debugging, it just wouldn't cooperate. I really don't want to wire up another board like the dragonhide unless I have to as recommended by kscharf.

I saw a USB programmer/debugger from Futurlec for around $35. This one is more limited in the MCUs it can program and it can't do anything but JTAG. But, the price is right and if this is more robust than the AVR Dragon, it might be worth it. The Dragon is breathing fire on me right now and I don't like it! I really don't want to drop over $300 for a AVR JTAGICE mkII right now. So, has anyone used the Futurlec programmer?

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

If you have really long cables between the Dragon and the target that could be your problem. The DragonHide might help, but a simple solution might be a better cable. Make a cable with ground wires between EVERY active signal. You can cut up one of those 'super ide' cables with .025" spacing between the wires, these have the extra ground leads. You'll have to carefully fan out the wires at the ends to get them into the IDC connectors and connect all the grounds together. You'll end up with a cable that works like the one supplied with the Atmel JTAGMKII.

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

My current cable is 5"-6" long. I don't know if that's considered really long or not.

Before hacking up a new cable, let me try a shorter one (3"-4"). Thanks for the suggestions.

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

devils4ever wrote:
My current cable is 5"-6" long. I don't know if that's considered really long or not.

Before hacking up a new cable, let me try a shorter one (3"-4"). Thanks for the suggestions.


If it's less than a foot long you shouldn't have any problems, unless the environement is rather nosiy.
Also try powering the Dragon from a re-powered USB hub.

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

I just had my first problem with the Rev1 Dragon, it failed in the middle of programming. I forgot I had a 100GB laptop USB drive powered from the same port and I suspect the Dragon boost circuit was in operation, as it was warm to the touch. Unplug it before touching that part of the board, and if it's at all warm that could be an indicator of insufficient USB voltage.

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

I made up a 2" cable and have not had an issue yet programming the MCU. I guess the longer cable was causing problems. This is surprising. What frequency does the JTAG clock run at?

I have not tried debugging, but I assume it will run okay now.

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

Clawson wrote:
...shorter cables (100mm or less) are preferred...

That should be 10mm, man! ( how do I get "clawson wrote" to go where quote is ?! )

edit: Thanks David.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

Last Edited: Sun. Nov 7, 2010 - 09:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Type [quote_tag="name in quotes"]...[/quote_tag]

No, 100mm is a sensible length. That is 4 inches to the underdeveloped world.

I do not use a Dragon, but would guess < 150mm should work.

David.

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

indianajones11 wrote:
That should be 10mm, man!
An American using metric units ...

Stealing Proteus doesn't make you an engineer.

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

Quote:
An American using metric units
And almost proud of it... I was thinking 10cm :oops:

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1