uploading to arduino from a mac

Hello All,

I am having problems uploading to my arduino diecimila. I receive the following error message:

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

after typing the following code.

#define ENDSTOP_PIN 2

void setup()
{
pinMode(ENDSTOP_PIN, INPUT);

Serial.begin(9600);
Serial.println("Starting opto endstop exerciser.");
}

void loop()
{
if (digitalRead(ENDSTOP_PIN))
Serial.println("blocked.");
else
Serial.println("open.");

delay(500);
}

I was able to upload programs for a while but I began to receive the error message after wiring up an opto endstop kit for a reprap machine... http://www.reprap.org/bin/view/Main/DarwinOptoEndstop
This component attaches to the +5v, Gnd and digital pin 2 on the aduino.

I am using a mac powerpook G4 with OSX 10.3.9 and Arduino 0011 Alpha editor. After experience problems uploading to the controller I installed the FTDIUSBSearialDriver_v2-1-9.dmg from the drivers folder. But as I said I was able to download before attaching the opto endstop kit to the Arduino. And of course I was not able to upload after installing the driver either. Any ideas would be greatly appreciated?

cheers!

Hmm... can you try it on a different computer? (To try to see if it's the computer or the board.)

Try uploading with nothing attached to the board.

When you try to upload does the L LED blink (once or twice)?

Maybe I can return the favor of someone pointing me the right direction. Check out:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210898028/10#10

Get down to reply 9 and see if it helps you, too. I'm running a MacBook Pro so it's the Intel flavor of driver but removing RXTXcomm.jar from Library/Java/Extensions fixed it right up.

Good luck

mellis,

Now the L LED does not blink at all when I am uploading from the mac. I have tried disconnection all of the wires before I upload... nothing there. I installed the software and drivers on a windows xp pc as well and the same thing happened. It would upload a couple of times and then quit with the same error message.

When I plug it into my mac usb port the L come on once for a couple of seconds. When I plug it into the usb on the pc the computer acknowledges that something has been plugged in but when I attempt to upload I receive the same error message. It seems odd it would work for a while on both machines and then quit. Any ideas?

Mac4MRR,

Thanks for the tip I will check out the link...

cheers!

Since there seems to be a program in your Arduino which sends data to the serial output, have you tried typing

cat /dev/cu.usbserial-A4001uwp (or whatever your serial port is) in a terminal window to check if the arduino's serial link works ?

I assume the board have no problem booting up (pwr led on, etc.)

On the mac the PWR led and the L led both come one when I connect the usb cable.

Also on the mac I have the following choices for serial ports:

/dev/tty.modem
/dev/cu.modem
/dev/tty.usbserial-A6004cn6
/dev/cu.usbserial-A6004cn6
/dev/tty.bluetooth-pda-sync
/dev/cu.bluetooth-bda-sync
/dev/tty.bluetooth-modem
/dev/cu.bluetooth-modem

When I select either /dev/tty.modem or /dev/cu.modem and attempt to upload to arduino neither the tx or rx leds blink, the L led remains on and I receive the following error:

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

When I select either the /dev/tty.usbserial-A6004cn6 or /dev/cu.usbserial-A6004cn6 and attempt to upload to arduino the L led turns off and the rx led faintly blinks a couple of times and I receive the following error:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

One the PC I have the following choices for serial ports:

COM3
COM11

When I plug the usb in both the TX and RX leds flash quickly but the L led does not come on it occasionally but rarely flashes when I plug the usb in. When I select COM11 I am able to upload about to arduino about 1 out over every 30-40 attempts, but it is very sporadic. Most of the time the RX led faintly blinks a couple of times and I receive the following error:

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

As I said I was able to upload from both the mac and pc machines very smoothly about five times before the glitches began. Has anyone else out there had similar difficulty? completely clueless....What am I doing wrong?

It sounds like there's something wrong with the chip (ATmega168) on your board. The L LED should flash once when you press the reset button; does it? If not, then it sounds like the bootloader's not running properly. You might need to reburn it (using an ISP like the USBtinyISP or an AVRISPmkII or a parallel port programmer) or replace it with a ATmega168 that's been bootloaded already.

did you try uploading with everything disconnected except for the mac? on pin 2 there can be set a interrupt handler witch can disrupt the bootloader. i have the same problem when using a vmusic2 via serial pins 0 and 1.