Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

avrdude: initialization failed, rc=-1
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

avrdude: initialization failed, rc=-1

by mschiff on Tue Feb 02, 2010 3:44 pm

i know this is a common issue among beginners but any help is appreciated.

I have an ATmega168 on an Evil Mad Scientist business card PCB. I am supplying +5V to the VCC in on the card, and I have ground attatched right next to it (5V supplied from the 5V pin of an arduino mega).

I have a wire jumper from AVCC to voltage in, and the ISP headers are soldered on and connected correctly through the EMS business card.

As far as I can tell I have everything hooked up correctly on the chip end.

I am running MacOSX and using crosspack for mac, one of the avr packages you link to on your basic AVR tutorials.

I have an LED hooked up through a resistor to PD4 and I am just trying to get that pin set to high. My goal was to ween myself away from the arduino and begin programming avr in the standard embedded C, but as of now I am stuck with my programmer unable to contact the chip : / Can anybody point me in the right direction??
-Michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by jgotthardt on Tue Feb 02, 2010 6:48 pm

Is this a "factory fresh" ATmega168? Or one that's been pulled out of an Arduino or other board?

If the latter, the fuses have probably been changed from their default values and you will have to provide an external clock source. A 1 MHz square wave connected to XTAL1 usually works well. If it's out of an Arduino an 8 to 16 MHz ceramic resonator or crystal plus caps in the space provided on the EMS board should do the trick.

Also, if you insert the Vcc jumper on your USBtinyISP you won't have to provide +5V from your Arduino Mega. This makes for a very clean breadboard set-up.
John

jgotthardt
 
Posts: 33
Joined: Mon Dec 03, 2007 11:58 am
Location: Massachusetts

Re: avrdude: initialization failed, rc=-1

by mschiff on Tue Feb 02, 2010 7:05 pm

This is a factory fresh ATmega, came with the EMS boards.

how do I connect that jumper you were talking about? my setup is clean but that sounds cleaner, although right now all I really care about is talking to the chip.

-Michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by mschiff on Tue Feb 02, 2010 7:11 pm

also

the first time i tried to program the chip I did not get this error, the light I intended to power did not turn on but I think I sucessfully programed the chip. All further attempts on that chips returned the error.

I have since tried to program other factory fresh chips and gotten the same problem.

could it be on the computer end? my serial ports are busy from previous attempts???
-michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by adafruit on Tue Feb 02, 2010 10:14 pm

hmm you could try post a photo, we'll take a look

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by mschiff on Tue Feb 02, 2010 10:41 pm

Here are some pictures of the board.

Note: it may seem in the last picture that the jumper goes from voltage to AREF instead of AVCC but it is correctly hooked up to AVCC as i hope is clear in the other pictures. However the last picture depicts the other circuitry more clearly.

You can see the resistor from PD4 to the prototyping area, where it meets the positive lead of the LED. The negative lead of the LED goes to the bus strip which I then connected to ground.

The only other connections i made on the board were to attach the ground and VCC in to the board, and those are the two wires that can be seen running from the baord.

The ATmega is connected to the board through a ZIF socket.

thanks for the help
-Michael-
Attachments
Good3.jpg
Good3.jpg (101.77 KiB) Viewed 6158 times
Good2.jpg
Good2.jpg (109.05 KiB) Viewed 6158 times
good1.jpg
good1.jpg (104.48 KiB) Viewed 6158 times
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by adafruit on Wed Feb 03, 2010 12:48 am

kinda hard to see.. can you make it less blurry/dark/blue and flip 'em the right way? so close!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by mschiff on Wed Feb 03, 2010 1:49 am

The pictures are blurry because I used the built in camera on my laptop, actually that explains all of the faults with the photos.

Ill take better photos and send them to you. Should I just post them to this thread or create a new one?
-Michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by adafruit on Wed Feb 03, 2010 12:08 pm

just post em here. we check the forums constantly. :)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by mschiff on Wed Feb 03, 2010 5:05 pm

Im working on borrowing a camera right now and I should be able to have clearer images posted by the evening, but I feel like the pictures I posted show the (few) necessary connections that are made on this board.

I have VCC and GND in
I have VCC and GND to the chip through the internal traces in the EMS board, I have AVCC connected through an external jumper wire.
The ISP header is soldered in place, and the EMS board provides traces that connect the 6 header pins with the appropriate pots on the microcontroller.

And lastly, I am sure that the controller is correctly oriented in the ZIF socket.

I will still post better photos, but right now I am not sure what could really be wrong with my hardware setup. Any thoughts?
-Michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by adafruit on Wed Feb 03, 2010 10:29 pm

http://www.adafruit.com/images/large/at ... et_LRG.jpg
is the photo we have
you could also check if your cables are backwards maybe?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by mschiff on Thu Feb 04, 2010 3:53 am

Hmmmm, Ill try setting it up like that, mine looks very much the same except i dont have the jumpers to AREF and the GND connection on the other side. do you by chance know the capacitance of the cap. between Vcc (pin7) and GND (pin8).

thanks for the picture though, I hope it helps
-Michael-
-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by adafruit on Thu Feb 04, 2010 5:50 pm

"mine looks very much the same except i dont have the jumpers to AREF and the GND connection on the other side."

ok well, then its not a surprise it doesnt work, eh? :)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: avrdude: initialization failed, rc=-1

by mschiff on Thu Feb 04, 2010 10:40 pm

I actually found it kind of suprising because of the tutorial on the EMS website that shows the fabrication of a bare bones target board for avr chips, and I did not see those pins connected.

More to the point, I connected those jumpers this morning and attempted to program it and I got the same error.

I looked at some other similar posts on your forums and I saw that you had advised one person to check their cables coming out of the USBtinyISP so I did that and the red wire is on the correct side, and since the cable portion came pre-assembled in my kit I figured it would be okay.

Any ideas on what to try next?

-Michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Re: avrdude: initialization failed, rc=-1

by mschiff on Thu Feb 04, 2010 10:45 pm

I looked closer at the tutorial I spoke of before and I misread it the first time, so I believe that you are correct in that it shouldnt have worked without the AREF and GND pins on the right side connected.

However, I did connect those and it is still not programming.

Do you think it could be the capacitor that you have pictured between pins 7 and 8 because my board does not have that. Do you by chance know its capacitance value?

If not the capacitor then what?
-Michael-
mschiff
 
Posts: 26
Joined: Tue Feb 02, 2010 3:35 pm

Please be positive and constructive with your questions and comments.