Pages: [1]   Go Down
Author Topic: Help please. Error uploading to Arduino..  (Read 5244 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 44
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My Arduino software and board have been working perfectly until now.
When I run a simple Digital Read Serial program I get the follow error when I try to upload it to my Arduino.

Binary sketch size: 2248 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

It appears both my Board type and COM port are correct so I'm not sure what else it could be ..


Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which model/board do you have?
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6106
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This error is usually the result of the ATmega not getting reset automatically. 

Try pressing the Reset button on the board just after the "Binary Sketch Size" message.  You might have to try a couple of times to get it just right.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 44
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino script I am running is a simple "Digital serial read" script.
here is the script:
void setup() {
  Serial.begin(9600);
  pinMode(0, INPUT);
}
void loop() {
  int sensorValue = digitalRead(0);
  Serial.println(sensorValue, DEC);
}

I have discovered if I set my input pin to 0 I get the error message as outlined in the beginning of this post. If I set my input to 1 I get a strange serial output (not what I am expecting). If I set it to 2 I get the serial output I am expecting.

Are the digital pins 0 & 1 reserved for something else ?
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Digital pins 0 and 1 are shared with the serial communication that goes over USB to the computer.
Logged

Memphis, TN, USA
Offline Offline
Newbie
*
Karma: 3
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are using serial communication, then you can't use pins 0 and 1.  They're used in the background to talk to the computer.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had the same problem with my Uno same sketch and same error codes.
I am running Vista sp2 on a toshiba laptop.

I solved the problem by logging as admin and all worked as it should.

The guess as to the reason why, Vista in their weird way prevents access to serial ports unless in admin as a security measure (by the way I just got rid of a nasty bit of adware(netbits) which came thru a user account so much for security)
Logged

Memphis, TN, USA
Offline Offline
Newbie
*
Karma: 3
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I seem to have also developed this problem (and on the eve of my greatest breakthroughs on my project, too).  I circumvented it by going back to the 0021 IDE and running it as Admin (still using the 0022 drivers, though).  Uploads every time now.

Strangest thing - worked fine for 2 months, until now.  All of my problems seem to have stemmed from switching to the 0022 drivers and IDE.
ETA: Ran 0022 as Admin, and uploaded just fine.
« Last Edit: February 02, 2011, 07:47:40 pm by vulrath » Logged

Pages: [1]   Go Up
Jump to: