Mac OSX, Arduino Uno, and ATMega328p-pu Bootloading Solution

It’s been reported that you can’t bootload new 328pu chips with the Uno. This is complete horse-pucky. I’ve successfully done this with a 120k resistor (or series) on the reset pin to 5v. There were no problems bootloading with Windows and the Arduino-0022/0023 IDEs.

However, this was not the case in the Mac environment. What was the problem? I finally decided to WATCH the LEDs on the Arduino. This is usually a good indicator of what’s going on. Once you finally move from one frustration to the next, I’ve noticed in my life, that the myopic window begins to open up to other possibilities. Well, for some reason, in the Windows environment with the earlier IDEs, it didn’t care that the Uno was still resetting, even with the 120k resistor in place. I “assumed” the board wasn’t resetting. Clearly, from the LEDs, it was.

I ran across a great example for the proper breakpoints to set in avrdude using GDB here: http://mcnewton.posterous.com/hack-to-allow-the-arduino-uno-to-be-used-as-a. Sweet success. It IS possible to bootload from the Mac environment. A simple command allowed this to be done from terminal:

sudo gdb –args ./avrdude -P /dev/tty.usbmodemfa131 -b 19200 -c stk500v1 -p m328p -v -e -U flash:w:/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex -U lock:w:0x0F:m

However, even though I thought I could move on, I’m lazy, and still want to use the IDE to do the bootloading. One final test made all things possible. I placed a 6v 47uF cap from the reset pin to ground, leaving the 5v running through the 120k resistor. What did I find? The Uno stopped resetting and bootloading from the new Arduino V.1 IDE went off without a hitch.

This has been a great exercise in furthering my knowledge of the Uno and bootloading. Why settle with one operating system that works, when you should be able to do it from any? Hopefully, ol’ Chugs will get some time to test this from his Linux environment pretty soon, since that’s his primary operating environment. (I suppose I could quit being lazy and get a Debian VM running to test, but I want to move on!)

Attached is the circuit I used on the reset pin. It worked for me. Hopefully, it’ll work for you.

Also, here is the AVRDude error sequence I was getting, for reference. Hopefully, if you’re doing a Google search for this problem, this post will pop-up and provide enough information for you to get to Uno bootloading in a Mac environment.

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): unknown response=0x12

Leave a Reply