Basic Upload Error

I'm trying to upload a basic photoresitor input sketch:
// Photoresistor
// by BARRAGAN http://barraganstudio.com

int val;

void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}

void loop()
{
val = analogRead(0); // read analog input pin 0
Serial.print(val, DEC); // prints the value read
Serial.print(" "); // prints a space between the numbers
delay(100); // wait 100ms for next reading
}

And when I do, the Arduino program gives me this error:

Binary sketch size: 1940 bytes (of a 14336 byte maximum)

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

PLEASE HELP. I'm really, really, in need of some help here. I'm in way over my head.

I can get it down to 1900 bytes, with the same error codes, like this:
int val;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
val = analogRead(0); // read analog input pin 0
Serial.print(val); // prints the value read
Serial.print(" "); // prints a space between the numbers
delay(100); // wait 100ms for next reading
}

how exactly am I supposed ot get it smaller than that? How do I make more room on my board? Aaaaargh. sob

beats head on desk I'm looking in the Arduino troubleshooting guide. I'm supposed to have 14KB of space on teh board, once I take off the 2KB the core takes up. Why is 1900 bytes too much? I can't find avrdude anywhere. Help. Please.

Stop pounding your head, take some asprin and relax, this will be solved in time :wink:
First your program seems to be fine to me. It's size is less then 2K and will fit easily in the 14.336KB memory limit, that is all the memory message is trying to tell you, you have over 12KB of free program space.

The problem is the IDE doesn't seem to be able to communicate with the Arduino board when you try to upload the program. Check that you have the proper comm port number selected in the Arduino IDE tools tab. Also verify that you have selected the proper board from the tools section selected.

Try that and call me back in the morning :wink:

Lefty

if you try to upload a different sketch does the arduino communicate with the computer? Are the TX RX LED's doing their thing when you try to upload or do they sit there doing nothing. DO check your com ports as recomended above!

please tell us:

  • operating system you used
  • version of Arduino software
  • Arduino hardware name?

for example:
Mac OS X, 0015, Arduino Diecimila

and in that case: uninstall the FTDI chip drivers (search the forum for it) and then install the latest FTDI chip drivers (again, search the forum)

It is a communication error and can be caused by different things. Your code is ok and the size is no problem.

Hi guys

I have a fairly similar problem, so decided not to make a new topic.
Essentially, I was forced to get a new laptop and unfortunately it came with Vista. And as expected, I failed trying to get Arduino work with it.

I know Arduino itself works fine. I used it hundred times with my old laptop and XP. I'm also positive I indicate the right COM port to the software, it is looking for right type of the Arduino itself, etc.

The message I get from Arduino software is:
avrdude: stk500_getsync(): not in sync: resp=0x30
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

However, I know for sure this is not the software issue. It's to do with drivers or device recognition, actually. For one thing, I remember well that when long time ago was installing Arduino Software and then hooked up Arduino board to my old PC (that's unfortunately not among living any more), I had to install two drivers - one for USB Serial Converter and one for USB Serial Port. But when I wanted to to the same last night with the new laptop, Vista never asked me for the second driver :expressionless:
When I look in the device manager, it says the USB Serial Converter is there, but there's a little warning sign by it and when I click it, the prompt says "This device cannot start. (Code 10)".
I got the latest driver from FTDI, the issue as I see it is that there should be one more driver for the USB Serial Port, but I don't know how to point it out to Vista, since it doesn't show any interest in it itself. Nothing like "Update driver software" does the trick :expressionless: Well, I contacted FTDI about it, but perhaps someone here also knows how to tackle this.

One more funny thing - I actually got Arduino and Vista/PC to communicate for about two/three uploadings after I manually reset the board, but it never worked again. I'm seriously very confused here :expressionless:

Regards
Puchatek

I've noticed that I dont always get the same com port with the Vista usb driver. Sometimes it's COM4 other times its COM5, you have to make sure it's set correctly, even if you haven't changed anything.

I'm positive that was set properly.

I got the reply from FTDI, but it just says:

Code 10 is usually a hardware problem.
Try another USB cable or another USB port.

There are three USB ports on my PC and all of them work with my mouse, so ports themselves are intact, I suppose.

I still don't know how to install second driver in addition to the first one (so, one for USB Serial Converter and one for USBSerial Port), rather than overwriting the previous one. Any ideas? :expressionless:

Update:
Ok, so this begins to confuse me more and more.I tried manually resetting Arduino at the same instant as ordering Windows to reinstall drivers and it worked. It took just a single driver, not two of them, but it worked. In Device Managers it was listed as a USB Serial Converter, as before, but this time without any warning, nor Code 10 messages. I also succeeded in uploading a simple code on Arduino. But when all happy and meery tried to put a proper code, everything went astray again. I rebooted the PC, without unplugging Arduino and this time it was listed as Unknown Device in the Device Manager. After unplugging and plugging again, it became a USB Serial Converter once again, alas with wretched Code 10 message and so nothing was working again... Any suggestions what is really happening and how can it be fixed?