# How do I know I have the right Bootloader Installed on my ATMega328P-PU?

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 :

-correct Serial Port selected

-correct driver installed

-chip inserted into the Arduino properly

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

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

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.

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.

• 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. Dec 26 '13 at 4:04
• @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? Dec 26 '13 at 10:52
• 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 Dec 28 '13 at 7:26

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?

• 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 Dec 26 '13 at 4:42
• 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? Dec 26 '13 at 14:14

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.

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.