6
\$\begingroup\$

I got an ATMEGA328P-PU , already bootloaded , but when I tried to upload the program (a simple program for blinking the LED on pin 13 ) I'm getting an error as :

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

I have googled a lot and have tried numerous way to get rid of this error viz :

-press reset just before selecting Upload menu item

-correct Serial Port selected

-correct driver installed

-chip inserted into the Arduino properly

and followed every instruction on www.arduino.cc but heck

\$\endgroup\$
  • \$\begingroup\$ Have you tried reprogramming it? \$\endgroup\$ – Ignacio Vazquez-Abrams Dec 24 '13 at 12:32
  • \$\begingroup\$ What do you mean by reprogramming ? Did you mean uploading the program ? Well , more than a 1000 times \$\endgroup\$ – thebugger Dec 24 '13 at 12:33
  • \$\begingroup\$ Attaching to the ISP connection and reflashing it. \$\endgroup\$ – Ignacio Vazquez-Abrams Dec 24 '13 at 12:33
  • \$\begingroup\$ No , how is that done ? and what I can achieve with it? \$\endgroup\$ – thebugger Dec 24 '13 at 12:34
  • \$\begingroup\$ You get a ISP programmer and hook it up. It can reflash the entire chip, not just the part that the bootloader manages. \$\endgroup\$ – Ignacio Vazquez-Abrams Dec 24 '13 at 12:35
3
\$\begingroup\$

Have you ever programmed your ATmega328P successfully before? If not, that message most likely mean a configuration problem. It is just saying your IDE can't communicate with the MCU. It may take a while before you can successfuly program your ATmega for the first time. In this case, I can't help you without more information about your setup.

If you were able to program it at some point, but can't do it anymore, then the message you're getting from avrdude may be a sign that your MCU is no longer working.

To check if your ATmega is still alive, follow these instructions:

  1. Does the ATmega still display its heartbeat? Normally the bootloader for Arduino Uno and similar boards have a heartbeat feature to tell the users it's alive: it's three quick blinks on the LED attached to pin 13, right after boot. Does yours still do it? If so, you can relax: it's alive.

  2. If it does not blink three times anymore, has it ever blinked after boot before? For example, when you hooked up your Arduino board to a USB port in your computer (I'm assuming you have a USB board), has it ever blinked three times after boot?

I don't want to alarm you or anything. I'm not saying that your ATmega is burnt. But it is kind of difficult to really know when it is burnt. The message you're getting is one sign of it, but can be many other things. I have burned 3 of those chips, myself, and it is a sad moment, that's for sure.

In my case, a few things hinted at the problem. Before I had the problem, I was able to program my MCU using my Arduino Uno board. At some point, I did something that made the MCU stop working. Often is some short-circuit I caused when making changes to a circuit in a breadboard. After that event, the heartbeat stopped and I could no longer program the chip with my Arduino Uno nor burn a bootloader on it. The message from avrdude in all my cases were the same one you're getting. I could however program other ATmegas I had laying around using both methods (that meant it wasn't a problem with the board).

If your MCU continues to do the heartbeat, then it's alive and you are experiencing some other problem, probably communication or IDE configuration. What I usually try next is to burn the bootloader again. If the MCU is ok, it will happily take the bootloader. This way, you also make sure the right bootloader is in place.

\$\endgroup\$
  • \$\begingroup\$ Thanks for answering , no heartbeat is not alive , the LED on pin 13 is blinking continuously. So I bought a new ATMega (this time ATMega8P-PU) and burnt the boatloader myself and it's still giving the same error and then I tried again burning it , the error persist but the heartbeat is still alive. \$\endgroup\$ – thebugger Dec 26 '13 at 4:04
  • \$\begingroup\$ @user34427 Well, if the LED on pin 13 is blinking, then your ATmega328P is alive. It must be loaded with the Blink.ino sketch. There seems to be a problem in your setup that prevents you from programming it. You sure your board supports the 328? \$\endgroup\$ – Ricardo Dec 26 '13 at 10:52
  • \$\begingroup\$ Well the MCU was dead , I replaced it and it's working fine. Now what I did is that , I tried boot-loading an ATMega8 , it is still giving this error. I have tried multiple times boot-loading the ATmega 8 , and seems that bootloader is burnt sucessfully , but while uploading programs, the error persist.I'm sure my Atmega is alive and running but it is still giving the error \$\endgroup\$ – thebugger Dec 28 '13 at 7:26
1
\$\begingroup\$

I would suggest buying one with the bootloader already programmed. That way you know can hook it up and verify the heartbeat blinks on power up. Once you have that try to load the blink sketch.

You say you are putting this in an Arduino? It could be that the usb interface chip is bad. What model board?

\$\endgroup\$
  • \$\begingroup\$ Hi, I bought an already bootloaded chip (already mentioned in the question ) , the heartbeat is not there , i.e. it's not blinking thrice. After that I bought an ATMega8a-P PU and tried burning bootloader and I done that successfully thrice , but in vain \$\endgroup\$ – thebugger Dec 26 '13 at 4:42
  • \$\begingroup\$ How did you burn the bootloader? How do you know that was successful? Where exactly are you putting the chip after you burn the bootloader? \$\endgroup\$ – BrianK Dec 26 '13 at 14:14
1
\$\begingroup\$

In your tags you used Arduino so I guess you have one.

So first I woud place the ATMEGA328P-PU in right direction onto the board (nose in ICSP-Pin direction). Try to burn the Bootloader once more and if you have also try to use a other ATMEGA328P-PU MCU. After this try to upload the blink-program again.

\$\endgroup\$
0
\$\begingroup\$

The best way to make sure you have the right bootloader is of course to program it yourself. If the issue persists after flashing the right bootloader (or you can't flash the bootloader), the next suspect would be baudrate mismatch. You will have to check the following settings:

  • the right target board is selected in IDE settings
  • the XTAL clock (f_cpu paramter in board.txt) matches what you really have on your board (many Arduino clones are mostly compatible with original except for quartz frequency)
  • the baud rate for uploading your software (upload.speed parameter in board.txt) matches whatever bootloader you have (if you can't reflash the bootloader, you may want try several values and see which one works. Default is usually 19200).

Note that there'a great site https://arduino.stackexchange.com/ where Arduino experts hang out, so in the future you may want to ask your Arduino-specific questions there.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.