Trouble uploading 'Blink' to Arduino Mini

Hi everyone,

This is my first time working with an Arduino, and I’m having some issues uploading the ‘Blink’ sketch. I haven't had much luck searching the forums, so I would greatly appreciate any suggestions!

I have an Arduino Mini with the ATmega328 connected to my MacBook (OS X Version 10.6.5, 2.4 GHz Intel Core 2 Duo) via a serial-USB adapter. I have the circuit connected as is shown on the Arduino website (http://arduino.cc/en/Guide/ArduinoMini).

In the Arduino program I have the board selected as “Arduino Pro or Pro Mini (5V, 16MHz) w/ ATmega328", and the Serial Port set to /dev/tty.usbserial-A9007W6X.

When I reset the board, the LED on pin 13 flashes 3 times, then I hit upload, and after a few seconds I get the following error message:

avrdude: stk500_getsync(): not in sync: resp=0x12
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x12

I have confirmed that the USB connector is working by using the terminal, so I’m afraid it might be something with the board itself. I have also tried selecting different boards in the board menu to no avail.

Here’s what I get when I hit shift+upload:

Binary sketch size: 1018 bytes (of a 30720 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/tty.usbserial-A9007W6X -b57600 -D -Uflash:w:/var/folders/3q/3qc+TaF2Fxek69KqFbEBdU+++TI/-Tmp-/build3438798255416031775.tmp/Blink.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 9 2007 at 11:20:31
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/Kara/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbserial-A9007W6X
Using Programmer : stk500v1
Overriding Baud Rate : 57600
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [12]
avrdude: stk500_getsync(): not in sync: resp=0x12
avrdude: Send: Q [51] [20]
avrdude: Recv: . [12]
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x12

avrdude done. Thank you.

Again, any suggestions are greatly appreciated! Thank you! If any other info would be helpful, just let me know.

Did you hit reset and THEN hit upload? That's backwards. Hit upload, wait until you see compiled size of your sketch, then hit reset.

Thanks for the reply. I tried doing that, and I'm still getting the this error...

avrdude: stk500_getsync(): not in sync: resp=0x12
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x12

You need to select "Arduino Mini" not "Arduino Pro or Pro Mini" from the boards menu. The naming is confusing, I know. If you still have problems, try varying the timing of resetting the board vs. pressing upload.

Thank you for the suggestions! I tried various reset times with the Arduino Mini board selected, and I get a variety of errors based on the reset time. I've tried several resetting strategies based on the suggestions in the forum and the Troubleshooting guide.

Is there any way to tell from the error what is going wrong with the communication between the board and the program? Again, I really appreciate the help!

I keep getting this error for various reset/upload timings:

avrdude: stk500_getsync(): not in sync: resp=0x20
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x20

If I wait more than about 4 seconds after hitting upload then I get this error:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x20

I've tried both USB ports in my computer with no difference. I noticed that if I change the Serial Port from /dev/tty.usbserial-A9007W6X to /dev/cu.usbserial-A9007W6X, I get the same 'not in sync' behavior. I also get the same 'not in sync' error when I hit upload with or without resetting. Does this indicate a problem with the board or the connection?

Thank you for any suggestions!

Try verbose upload (hold shift when clicking the upload button). The main thing it will tell us is if there's no communication happening at all with the board, or incorrect communication happening. If there's none at all, it's hard to isolate the problem. Try pressing reset a bit sooner; the bootloader on the Mini should wait 6-8 seconds or so before giving up and starting whatever sketch is already on the chip.

Did you connect the grounds between the Mini and the USB-serial convertor?

Here's what I get with the verbose upload:

Binary sketch size: 1018 bytes (of a 14336 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega168 -cstk500v1 -P/dev/tty.usbserial-A9007W6X -b19200 -D -Uflash:w:/var/folders/3q/3qc+TaF2Fxek69KqFbEBdU+++TI/-Tmp-/build2906900078076693611.tmp/Blink.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 9 2007 at 11:20:31
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/Kara/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbserial-A9007W6X
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: [20]
avrdude: stk500_getsync(): not in sync: resp=0x20
avrdude: Send: Q [51] [20]
avrdude: Recv: [20]
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x20

avrdude done. Thank you.

Occasionally, instead of resp=0x20, it will list resp=0xcc or resp=0xc0. This seems to happen most often when I reset and then hit upload right after the LED blinks 3 times. Not sure if it will be useful, but here is the verbose upload for when that happens:

Binary sketch size: 1018 bytes (of a 14336 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega168 -cstk500v1 -P/dev/tty.usbserial-A9007W6X -b19200 -D -Uflash:w:/var/folders/3q/3qc+TaF2Fxek69KqFbEBdU+++TI/-Tmp-/build2906900078076693611.tmp/Blink.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 9 2007 at 11:20:31
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/Kara/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbserial-A9007W6X
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [c0]
avrdude: stk500_getsync(): not in sync: resp=0xc0
avrdude: Send: Q [51] [20]
avrdude: Recv: . [a0]
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xa0

avrdude done. Thank you.

I have the grounds connected, and I checked the voltages on the Mini to make sure the +5 and ground pins were at the correct voltages.

Thank you for your help.

Sorry, now I'm confused. Do you have an Arduino Mini or Mini Pro? Can you take a picture of the way you have it connected?

Haha, I'm confused too. The board that I ordered was labeled "Arduino Stamp", and on the board itself it says "Arduino Mini 04". The chip on the board is labeled 328, however, and I was under the impression that the Minis had a 168 chip....so I was confused. I ordered the chip from Sparkfun, and I haven't gotten a useful explanation yet from them about the chip itself.

I attached a picture of my board setup. I have a SPDT switch connected between power and ground, so that the board resets when the switch is pressed.

I am halving the exact same issues that Knb12 is having. I will get either of those 2 errors.. i am looking forward to a solution.

I have this exact issue as well. Anyone have a solution? I've tried uploading the latest drivers, tried using reset button at different times with no avail.

Thanks,

Hi everyone, sorry for the huge delay in replying.

I ended up talking to Sparkfun tech support, and they recommended just sending the Stamp back and getting the Mini Pro instead. The Pro worked the first time I connected it to my computer.

I don't know if there is a better solution than replacing the board...but I was on a time crunch so it was the best option for me.

Thanks to everyone for their advice and suggestions!