Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
leon_heller
PostPosted: Mar 26, 2010 - 12:18 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

I don't have any problems using the Dragon for debugging, but I can't seem to be able to get it to work as a programmer. The main problem is that it can't read the device code: with a Tiny45 target and the PP/HVSP mode it reads the signature as all zeros. With ISP selected I get an error message.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Mongooose
PostPosted: Mar 26, 2010 - 12:21 PM
Rookie


Joined: Sep 25, 2008
Posts: 33
Location: Alabama

IS this programming being done on the Dragoon itself, in the proto type area, or on a board? Tiny45 powered by dragoon during programming?

Edit: If programming on Dragoon in ziff socket or something or powering from dragoon, the dragoon seems very susceptible to length of wires, wires just long enough to jumper the headers on board and I never have problems. If the MCU has its own power supply on a separate board I can use much longer wires (8"-10").


Last edited by Mongooose on Mar 26, 2010 - 12:25 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Mar 26, 2010 - 12:24 PM
Raving lunatic


Joined: Feb 12, 2005
Posts: 7752
Location: Cratfield, England

It may have got itself into debugwire mode.

Try 'avrdragon.exe -W'

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2010 - 12:26 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 34712
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

It may have got itself into debugwire mode.

But does that matter if you use High Voltage? I thought the whole point of HV was that you could "get it back" whatever state it was in?

(I've certainly contacted 168's on an STK500 with HV and I think all that was "wrong" was they were in dW mode)

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 12:36 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

The board is connected via a short cable, about 15 cm.

Programming the fuses doesn't work, either. I get the same error message:

P.../HVSP Mode Error.

I tried avrdragon -W but it expects a device type, and none of the ones I tried worked. I tried tn45, ATtiny45, attiny45, etc.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
david.prentice
PostPosted: Mar 26, 2010 - 01:11 PM
Raving lunatic


Joined: Feb 12, 2005
Posts: 7752
Location: Cratfield, England

Are you sure?

Code:
avrdragon.exe -d ATtiny45 -W


should be recognised.

I have only used JTAGICEmkII.exe but I would assume the dragon works the same way.

n.b. You must have the ISP lines connected to enter / leave dW. Once in dW, the ISP lines can be removed.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 01:26 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

It didn't like that, I got:

C:\Program Files (x86)\Atmel\AVR Tools\AvrDragon>avrdragon -d ATtiny45 -W
avrdragon.exe v1.0.2 Copyright (C) Atmel Corporation 2006-2008
Regenerating part cache file...
Failed to load .cac file. Unable to determine supported devices.
Use '-h' or '-?' for help.

I just tried a Tiny2313 again. It appears to write to the fuses if I only select the oscillator (ext. crystal 8 MHz-) but if I select anything else like BOD, it fails. In fact, it's not really writing anything, it already had that setting so it verifies OK.

I'll try Atmel support and see what they say about it.

I don't get problems like this with PICs, or any other MCU!

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2010 - 01:40 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 34712
Location: (using avr-gcc in) Finchingfield, Essex, England

Silly question but you have got it wired as per the manual:

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 01:58 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

No, I didn't add any of those connections. That could be the problem. I'll solder the HV connector and make up some jumper cables.

That might be OK for the Tiny45, but the Tiny2313 is a SOIC, and I can't plug it into the ZIF socket. There must be another way to fix it.

It would be easier if I could get David's technique to work. I got the same error with the Tiny2313.

_________________
Leon Heller
G1HSM
leon355@btinternet.com


Last edited by leon_heller on Mar 26, 2010 - 02:14 PM; edited 1 time in total
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2010 - 02:13 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 34712
Location: (using avr-gcc in) Finchingfield, Essex, England

Leon,

But is the device in a socket on the Dragon board (I guess you may have mounted a ZIF?). If you are actually trying to HVSP it in circuit then those A..F on the ISP and HV headers need to run to the given pin numbers on the device as shown on the device header.

Like the STK500 this is why HV programming always seems like such a fiddle-faddle to me. The STK600 is MUCH more intelligent in that it hides all this signal routing nonsense in the routing cards that make up the target socket "sandwich" (but, of course, you pay for that privilege!)

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 02:21 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

I've got both the devices on PCBs, with a six-pin ISP header. The Tiny45 is socketed but the Tiny2313 is a SOIC. I added the ZIF socket to the Dragon when I first got it a couple of years ago, but I've never used it.

I can plug the Tiny45 into the ZIF socket, but I don't see how I can make those connections to the Tiny2313 on my target board. It might be easier to simply replace the chip.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2010 - 02:35 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 34712
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

It might be easier to simply replace the chip.

That often seems to be the case when you hit the HV wall!

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Mar 26, 2010 - 02:37 PM
Raving lunatic


Joined: Feb 12, 2005
Posts: 7752
Location: Cratfield, England

But if you have the Tiny2313 ISP header and the Tiny45 ISP header then you never have to move anything.

The caveat is of course 'DON'T blow the RSTDSBL fuse'.
It is certainly easier to just replace chips.
To unsolder and put into a Dragon, and resolder is more than my life is worth.

I have used debugWire on both Tiny85 and Tiny2313. It works fine. You have to put the ISP lines back when you re-enable ISP.

You had of course noticed that the Tiny45 uses some strange ISP pins. You have to do several jumpers on the STK500. But you would have already hard-wired these pins to your ISP header.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 02:44 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

The strange thing with the Tiny45 is that I have the ISP connections on my PCB, so I should be able to get into ISP mode. I can't find a command for it, though.

I just put a brand new chip in the Tiny45 board and I can read the signature on that, program the fuses and program my code into it.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
david.prentice
PostPosted: Mar 26, 2010 - 03:02 PM
Raving lunatic


Joined: Feb 12, 2005
Posts: 7752
Location: Cratfield, England

Double check your ISP routing. You need PB0, PB1, PB2, /RESET. A virgin has its own (1MHz) clock. It will come out of the box ready for ISP.

I do not use a Dragon. Surely it ISP's all other chips ok.

Do you have a JTAGICEmkII to try?

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 03:30 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

I've got one of the old ones, it only has a 10-way JTAG connector.

I've got PB0, PB1, PB2 and /RESET connected to the ISP headers on my Tiny45 and Tiny2313 PCBs.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
MBedder
PostPosted: Mar 26, 2010 - 03:33 PM
Resident


Joined: Nov 02, 2009
Posts: 535
Location: Zelenograd, Russia

Try lowering the ISP frequency to 125 kHz.
 
 View user's profile Send private message  
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 04:00 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

I've found the solution! It's AVR Dragon Options > Disable debugWire. I now vaguely remember using it a long time ago, when I last did some AVR development. Atmel should mention it in the Help. I can now use program mode on both the Tiny45 and Tiny2313.

Thanks for the suggestions.

I have other problems using the Dragon with a new Mega32 board that I was sent for review, but those are completely different.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
js
PostPosted: Mar 26, 2010 - 09:47 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13065
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Quote:
I've found the solution! It's AVR Dragon Options > Disable debugWire.
Yeah. It only gets mentioned once a twice a week here. Wink

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
leon_heller
PostPosted: Mar 26, 2010 - 09:50 PM
Raving lunatic


Joined: Jul 27, 2001
Posts: 5452
Location: St. Leonards-on-Sea (UK)

The external clock problem seems a lot more common. I've never fallen for that one, at any rate.

_________________
Leon Heller
G1HSM
leon355@btinternet.com
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits