avrdude: initialization failed, rc=-1

by sahirmathur on Sat Jan 29, 2011 2:11 am

I have recently purchased this device
http://www.adafruit.com/index.php?main_ ... ucts_id=46

I am using this to program this
with http://www.adafruit.com/index.php?main_ ... ucts_id=54

I am using windows 7 x64 with the driver for x64 available on the downloads page

This is what i get with avrdude

Code: Select all | TOGGLE FULL SIZE
C:\Users\Sahir Mathur>avrdude -c usbtiny -p t2313

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.



What should i do?
Attachments
28012011607.jpg
Complete system
28012011607.jpg (615.24 KiB) Viewed 4438 times
28012011605.jpg
Solder, back
28012011605.jpg (662.59 KiB) Viewed 4438 times
28012011604.jpg
Top Picture without cables
28012011604.jpg (670.61 KiB) Viewed 4438 times
sahirmathur
 
Posts: 3
Joined: Sun Jan 09, 2011 7:41 am

Re: avrdude: initialization failed, rc=-1

by jtwink on Sun Jan 30, 2011 5:10 pm

I think I am having a similar problem as sahirmathur. I also recently ordered from Adafruit both a USBTinyISP and an Attiny2313 (same links).

As per the "How to get help!" post, here are my details:

1) I am using a USBTinyISP from a kit
2) I am using Windows 7 professional 64-bit
3) I am using AVRDude and the Attiny2313
4) I have never used the USBTinyISP for programming anything except this chip
5-6) Screenshots below:

I wanted to do this using a breadboard. To make connections to the ISP header (?) easier, I soldered some right angle male headers to some straight ones. I checked the connector and all six connect through the breadboard fine and do not cross each other. Then I wired the various pins accordingly (used an example off the web - http://www.evilmadscientist.com/article ... rgetboards):
BreadBoard_prog_disconnected.jpg
Breadboarded Attiny2313
BreadBoard_prog_disconnected.jpg (235.72 KiB) Viewed 4416 times


The board itself went together without issue & looks right. Here's both sides of the board:
USBTinyISP_Both.jpg
USBTinyISP Both Sides
USBTinyISP_Both.jpg (632.79 KiB) Viewed 4416 times


I installed the drivers, WinAVR, AvrDude, etc. as per various instructions. I'm fairly sure I got the VCC and ground connected correctly because I set the jumper on the USBTinyISP and then put an LED on the breadboard & it lights up. Knowing where the power and ground were helped understand where the rest of the connectors were. I made sure I put SCK to SCK, MOSI to MOSI, etc. I also don't think I need a crystal to at least check if I can talk to the chip, right?

It also seems that the USBTinyISP is working. Running AVRDude with "avrdude -c usbtiny -p t2313" gives me initialization failed, which seems to indicate the computer is talking to the USBTinyISP, but still not the chip. From other documentation (http://www.ladyada.net/make/usbtinyisp/help.html) this seems to indicate either I've got it hooked up wrong or the chip is bad. I tried the same command with verbose (-vvvv) and got this:
Avrdude_Test2_verbose.jpg
AvrDude verbose
Avrdude_Test2_verbose.jpg (408.95 KiB) Viewed 4416 times


I _am_ new to this sort of development (used to Arduino so far), so I admit I'm probably missing something. In digging through various tutorials and FAQ's, though, I am at a bit of a loss to discover exactly what.

Any help would be appreciated. Thanks!

Jim Wink
jtwink
 
Posts: 2
Joined: Sun Jan 30, 2011 4:02 pm

Re: avrdude: initialization failed, rc=-1

by adafruit on Sun Jan 30, 2011 6:23 pm

it is almost definitely not a 'programmer' problem but a chip/wiring/clock/etc problem

http://www.ladyada.net/make/usbtinyisp/help.html
User avatar
adafruit
 
Posts: 11643
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by sahirmathur on Mon Jan 31, 2011 6:26 am

@jtwink
Is that a capacitor i see on your breadboard?

@adafruit
does this chip need a clock?
sahirmathur
 
Posts: 3
Joined: Sun Jan 09, 2011 7:41 am

Re: avrdude: initialization failed, rc=-1

by jtwink on Sat Feb 05, 2011 1:54 pm

No capacitor - it's all connected directly to the USBTinyISP. You may need a couple of capacitors and crystal for clock, but to check whether the chip can talk to the USBTinyISP, I think you can do without anything extra. At least it seems so based on what I've seen in other examples:

http://blog.hackerspace.my/programming- ... usbtinyisp

Granted this is an earlier iteration of the USBTinyISP, but I think the following command should work:

avrdude -c usbtiny -p t2313 -P usb -C C:\WinAVR-20100110\bin\avrdude.conf
jtwink
 
Posts: 2
Joined: Sun Jan 30, 2011 4:02 pm

Re: avrdude: initialization failed, rc=-1

by sahirmathur on Sun Feb 06, 2011 8:25 am

Do i need an external clock? because in the datasheet of the Attiny2313 it mentions an internal oscillator
If i need one, what speed clock would you recommend?
sahirmathur
 
Posts: 3
Joined: Sun Jan 09, 2011 7:41 am

Re: avrdude: initialization failed, rc=-1

by adafruit on Sun Feb 06, 2011 12:38 pm

a brand new attiny2313 has an internal oscillator, a programmed one may not have it selected
User avatar
adafruit
 
Posts: 11643
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by cfaulkingham on Tue Feb 15, 2011 4:19 pm

@jtwink Isn't that smaller capacitor TOP LEFT supposed to be on C1 instead of BUS. See http://www.ladyada.net/images/usbtinyis ... nyhack.jpg

BTW, I am having the same issue and I can't figure out what's wrong either. I have tried using a simple target board from EMS and I also tried bread boarding it; neither worked. I am trying to program a Tiny2313. I tested to make sure the Tiny2313 was getting power and it was. Also my green light comes on when connected to USB and the red light flickers when I send it a command via AVRDude.

I have ordered and Oscilloscope so that I can try to debug it. I wish I had a know working target board so I could determine where the problem is.
cfaulkingham
 
Posts: 15
Joined: Tue Feb 15, 2011 4:17 pm

Re: avrdude: initialization failed, rc=-1

by Dr Hobby on Wed Feb 16, 2011 2:56 pm

I am having same problem also. Green light comes "ON", red light flickers indicating sending data, then error msg flies up. I have rechecked wiring several times all appears ok, I can measure VCC & Gnd with DVOM, still error messages. Can I send mine in and have someone test it?
Dr Hobby
 
Posts: 1
Joined: Wed Feb 16, 2011 1:50 pm

Re: avrdude: initialization failed, rc=-1

by adafruit_support_bill on Wed Feb 16, 2011 3:53 pm

@Dr Hobby - post some photos of the front & back of your board and we will look for any assembly issues.
User avatar
adafruit_support_bill
 
Posts: 28151
Joined: Sat Feb 07, 2009 9:11 am

Re: avrdude: initialization failed, rc=-1

by cfaulkingham on Wed Feb 16, 2011 6:52 pm

@arduwino like I said in my previous post the green led comes on and the red led comes on when I send it cmd via avrdude. Also, I put a multimeter on the Tiny2313 on the EMS target board and it was receiving power.

1) Adafruit USBTinyISP
2) MacBook running OSX 10.6: What OS and computer are you using?
3) Crosspack Toolchain trying to program a Tiny2313
4) It never worked.

$ avrdude -c usbtiny -p t2313
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Front of USBTiny
http://dl.dropbox.com/u/23267/USBTinyISP_front.jpg
http://dl.dropbox.com/u/23267/USBTinyISP_back.jpg

EMS Target Board,
http://dl.dropbox.com/u/23267/ems_avrt_front.jpg
http://dl.dropbox.com/u/23267/ems_avrt_back.jpg

Any help would be appreciated.
cfaulkingham
 
Posts: 15
Joined: Tue Feb 15, 2011 4:17 pm

Re: avrdude: initialization failed, rc=-1

by abqlewis on Wed Feb 16, 2011 7:04 pm

I don't know this was already talked about in the replies, but...
If you are using the ATTiny2313 meant for the USBTinyISP, it is probably already fused for an external oscillator, like in the USBTinyISP. You just installed an oscillator (XTAL) when you built yours. Without a fuse change or an external crystal, I don't think it will program. Try to get a brand-new, UN-programmed AVR to test your USBTinyISP. Or, get a copy of the crystal and caps in the USBTinyISP. Ironically. once you get it to program, you should be able to change the fuse to use the internal clock.

Adafruit - Are your USBTinyISP ATTiny2313's programmed and then fused for external crystal?
Last edited by abqlewis on Wed Feb 16, 2011 7:30 pm, edited 1 time in total.
abqlewis
 
Posts: 67
Joined: Fri Dec 11, 2009 1:19 am

Re: avrdude: initialization failed, rc=-1

by adafruit_support_bill on Wed Feb 16, 2011 7:15 pm

Yes, the USBTinyISP chips are programmed for an external crystal.
User avatar
adafruit_support_bill
 
Posts: 28151
Joined: Sat Feb 07, 2009 9:11 am