Go Down

Topic: Error Uploading Sketches getsync(): not in sync (Read 1 time) previous topic - next topic

bgsteiner

Recently I started using my Uno R2 as I got my teacher to start using the arduino platform in my digital electronics class. All went well for a long time and i was making programs and having fun but recently after uploading this code...

Code: [Select]
long readTemp() {
  long result;
  // Read temperature sensor against 1.1V reference
  ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
  delay(2); // Wait for Vref to settle
  ADCSRA |= _BV(ADSC); // Convert
  while (bit_is_set(ADCSRA,ADSC));
  result = ADCL;
  result |= ADCH<<8;
  result = (result - 125) * 1075;
  return result;
}

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println( readTemp(), DEC );
  delay(1000);
}


I get this error every time i try to upload a new sketch to the R2

"avrdude: stk500_getsync(): not in sync: resp=0x00"

The program above is working and is communication over serial properly. I have tried to burn the boot loader but i get the same result. I have also tried pressing the reset before uploading. I do notice also the Arduino does reset when it starts to upload and tries to communicate over serial as the RX and pin 13 led blink before the error appears. I have tried this on 4 separate computers all running windows 7 x64 and it had previously worked on the computers until that last program was uploaded. I have used this code before with out having this problem. Any help would be great thanks.

Also note after attempting to upload it resumes the code from above.

Nick Gammon

http://www.gammon.com.au/electronics

bgsteiner

Nothing is connected to the arduino its just it and the computer.

cparker153

I have the same problem on my Arduino Uno, i have tried changing the serial port, restarting the program, etc

Any Ideas?

Nick Gammon

Personally I destroyed one of my Unos accidentally, I guess by touching it when I had "static" on my hand. That maybe is what happened. Try the "loopback test" (see sticky). You could also try my "chip detector" sketch here:

http://www.gammon.com.au/forum/?id=11633

You need a second Uno to run that, but it could confirm whether or not your main processor chip is OK.
http://www.gammon.com.au/electronics

ponobill

Hi Nick, I have an arduino Uno that has suddenly developed problems (see the post Toasted??) so I tried your sketch from a second Uno I have. When I run it and open the serial monitor all I get is some random garbage characters. am I supposed to do anything other than run the sketch to see the output configuration?

Nick Gammon

Make sure your serial monitor is set to 115200 baud (you might have it at 9600). Then you should see some words or other.
http://www.gammon.com.au/electronics

ponobill

Ah, that's better. Hmm, doesn't look like my bootloader is present. I wonder how that got erased. I take it I need to buy a programmer and re-burn the bootloader??



Atmega chip detector.
Entered programming mode OK.
Signature = 1E 95 0F
Processor = ATmega328P
Flash memory size = 32768
LFuse = FF
HFuse = D6
EFuse = FD
Lock byte = C0
Clock calibration = 98
Bootloader in use: Yes
EEPROM preserved through erase: Yes
Watchdog timer always on: No
Bootloader is 512 bytes starting at 7E00

Bootloader:

7E00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E10: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E80: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7E90: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7EA0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7EB0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7EC0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7ED0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7EE0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7EF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F10: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F80: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7F90: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7FA0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7FB0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7FC0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7FD0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7FE0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
7FF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

MD5 sum of bootloader = DE 03 FE 65 A6 76 5C AA 8C 91 34 3A CC 62 CF FC

First 256 bytes of program memory:

0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
10: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
80: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
90: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF


Nick Gammon

Since you have that sketch running, you should be able to put the bootloader back:

http://www.gammon.com.au/forum/?id=11635
http://www.gammon.com.au/electronics

bgsteiner

Well I feel really stupid I found a resistor that had lodged under my board in my case that was shorting out the tx and rx pins with one of its leads. So now everything is fine no damage.
megaepicfacepalm.jpg

ponobill

Success!!!  Thanks Nick, my Arduino is back to life and I learned a few things too.

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview