I'm starting to learn how to program micro controllers. This is my current setup.

enter image description here

When I'm trying to flash a Hello World program with AVRDude I'm getting the following message:

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

I have checked most of the options in this guide but none of them seem to resolve this issue. Also using the 16MHz crystal does not help.

I wanted to ask you if you could check my setup and also point me to what I'm doing wrong.

Just to make it clear - my development environment is: Debian / Pocket AVR Programmer.

  • \$\begingroup\$ Can you share us the exact command line you use? Also, is the mentioned error the only output you get? \$\endgroup\$
    – jippie
    Commented Jul 22, 2012 at 19:38
  • \$\begingroup\$ sudo avrdude -P usb -c usbtiny -p m328p, and that's the whole output message. \$\endgroup\$
    – Lazy
    Commented Jul 22, 2012 at 20:30
  • 1
    \$\begingroup\$ FYI: I never have to use sudo for this If you do, I might be able to help you with a couple of udev rules to fix that, but that's off topic for this question. \$\endgroup\$
    – jippie
    Commented Jul 22, 2012 at 20:56
  • 1
    \$\begingroup\$ You're also missing decoupling capacitors at the power supply pins of the microcontroller. Don't leave them out! \$\endgroup\$
    – AndrejaKo
    Commented Jul 22, 2012 at 23:46
  • \$\begingroup\$ Try -v for a more verbose output message. \$\endgroup\$
    – vsz
    Commented Apr 9, 2014 at 5:38

2 Answers 2


Well two things, assuming you have the programming pinout correct you're missing loading caps for your crystal and a pullup resistor on the reset pin. As the default behavior on an unprogrammed chip doesn't use the crystal I'm betting it's the missing pullup that's getting you. Take a look at the following page, should clear all of this up.

Arduino on a prototype board

  • 1
    \$\begingroup\$ Doesn't the programmer control the reset pin? So you won't need a pullup resistor.. \$\endgroup\$
    – m.Alin
    Commented Jul 22, 2012 at 19:59
  • 4
    \$\begingroup\$ I also cannot see how the second (lower) power rail is connected. AFAIK the two power rails are not connected on most breadbords. This would mean that GND is not connected to the ATMega. \$\endgroup\$
    – hli
    Commented Jul 22, 2012 at 21:13
  • \$\begingroup\$ Can you bring some of the information from your link, the critical information really so that link rot does not damage the site? \$\endgroup\$
    – Kortuk
    Commented Jul 23, 2012 at 8:54

Not sure if it is worth an answer, but the formatting will go all wrong in a comment. Allow me to share with you a little batch file I use to program ATtiny's. Tiny's are pretty much the same to program as a Mega. Also notice I use a different programmer (-c), but that shouldn't be the difficulty here.

  • freq AVR clock frequency
  • baud is the baud rate that my programmer likes to communicate on
  • src is the source code that is to be compiled
  • avr the device type to be programmed
  • dev the device as it shows up in dmesg when I connect my programmer. This is actually the setting that I consider odd in your command.


avr-gcc -g -DF_CPU=$freq -Wall -Os -mmcu=$avr -c -o tmp.o $src &&
avr-gcc -g -DF_CPU=$freq -Wall -Os -mmcu=$avr -o tmp.elf tmp.o &&
avr-objcopy -j .text -j .data -O ihex tmp.elf tmp.hex &&
avrdude -p $avr -cstk500v1 -P$dev -b$baud -v -U flash:w:tmp.hex

You can check the exact device by typing dmesg | tail from a terminal. When I connect my programmer it says:

[816888.277342] usb 2-2.3: FTDI USB Serial Device converter now attached to ttyUSB1

Notice the ttyUSB1 device node name.

Coming to think of it ..., your error message might imply the problem isn't between your PC and the programmer, but between programmer and AVR. The latter case disqualifying my answer entirely.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.