Burning the Bootloader on ATMega328 using Arduino UNO as ISP

I get an error saying

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

which changes to

avrdude: stk500_getsyc(): not in sync: resp=0xc9
or
avrdude: stk500_getsync(): not in sync: resp=0xe9

after I try burning my program again.
So I decided to put this problem in front of you experts. Please spare some time. Thanks in advance.

Have you followed these steps:

Thank you so much for the reply. :slight_smile:
Yes, I followed "Circuit (targeting an AVR on a breadboard)"

"Using an Arduino board to program an ATmega. Because no external clock source is connected, the ATmega must be configured to use its internal clock." (The bottommost left Figure)

I get an error saying : avrdude: stk500_getsync(): not in sync: resp=0xd9 (Error while burning bootloader [in orange color])??

One more question: If the chip is already bootloaded, can I still overwrite that bootloader??
My chip was already bootloaded when shipped.??

Yes, you can reprogram the bootloader.

Since the original fuses were probably set for external clock, you will need an external clock to reprogram it.

http://www.avrfreaks.net/modules/FreaksArticles/files/21/Why%20you%20need%20a%20Clock%20Source.pdf
"To program the chip you need an oscillator source. But for example if you were using the internal oscillator, then accidentally enabled the external oscillator input, you won't be able to re-program! To reprogram you will have to get a TTL or CMOS level oscillator signal and apply it to the XTAL1. You could have also possibly change the clock source to an external crystal or external RC oscillator, so try all the different possibilities of oscillator sources to get the chip re-programmed."

Thanks for the reply :slight_smile:
That really helped.

"Since the original fuses were probably set for external clock, you will need an external clock to reprogram it."

But it seems like since my chip was bootloaded before being shipped (must have been set for external clock), I have to supply external frequency to set the fuses?? I wish I am wrong here??

Could you also explain to me the last 4 lines?? I saw them in the pdf too (thanks for that). But first things first - I never used the internal oscillator till now. I was never able to as my breadboard arduino bootloader isn't burning.
Please don't mind mentioning the location where I could change the clock source to an external RC oscillator?? Here is the boards.txt file snap:

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=arduino
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard

I changed the upload.protocol to "arduino" after I came across it on many forums. Still no help (not in sync [with all the 4 atmega328p-pu I have] (all bootloaded when shipped).

Thanks in advance. Need your help.

Hi ,i had some similar problems myself ,not in sync whatever i did.Finally i made it just by powering
+5v from an external power supply to the target mcu. It seems to me in my case
power supply from usb port was not sufficient.

while uploading bootloader i had also got an error like this "avrdude: stk500_getsync(): not in sync: resp=0x00"
can any one suggest me what have to do to rectify my problem

You haven't told us anything about what you are trying to do or how you have things wired up?

Have you read through all the earlier messages and do any of them apply to your situation?

Have you seen this page which I have used without any problems http://arduino.cc/en/Tutorial/ArduinoToBreadboard

...R

While it is certainly possible to string wires between an UNO running ArduinoISP and a breadboard with an ATmega or ATtiny, it certainly is not convenient an is often error prone.

The best solution is a dedicated AVR programmer, IMO. The second-best solution is:

I use an UNO with this shield and it has paid for itself many, many times over. You can even use it for ATtiny or with a simple jig, for the Adafruit Trinket.
http://forums.adafruit.com/viewtopic.php?f=52&t=44444

Ray

This manual http://arduino.cc/en/Tutorial/ArduinoToBreadboard states that the procedure doe not work with the Arduino UNO board, is at all possible to burn the bootloader into a ATMEGA328-UP using just a protoboard and Arduino UNO without a 16MHz crystal?

Thanks in advance.

So many things can frack up using arduinoISP sketch. The best current method to burn a bootloader into a AVR chip is to use Nick's sketch and tutorial.

Save yourself a lot of grief and check it out then use it.

gaianautas:
This manual http://arduino.cc/en/Tutorial/ArduinoToBreadboard states that the procedure doe not work with the Arduino UNO board,

Have you tried it? As I said earlier it worked fine for me.

...R

Actually, the exact quote is:

Note that these techniques only work with the Arduino Duemilanove w/ an ATmega328, not the Arduino Uno (or older Arduino boards w/ an ATmega168).

Specifically shows the Uno as the ISP.

currently, you cannot use an Arduino Uno as an ISP programmer because the optiboot bootloader does not support this sketch. A revision for this is in progress.

I have used an UnoR3 many times, it works. Somewhere since the original Uno and R3, the issue was fixed.

Ray

Hi,
I have successfully made my own arduino using atmega328, but the problem I am facing is that each time I have to upload or update the sketch I have to again bootload the atmega328 chip using arduino. Can anyone suggest any solution to this problem.
Thank you

Hello every one i have Atmega328 ,Arduino UNO r3 board .when i power on and press reset switch pin 13 LED not toggle but continues on.And when i try to load firmware it give error avrdude: stk500_getsync(): not in sync: resp=0x00. i have found so many solution from other forum like uninstall driver and reinstall, 2)select proper COM ,3) select proper board , but i have not success yet, so Please any idea how i can resolve my problem . and is my board damaged,? when i try to load code on onther board it load success fully . so no driver or com problem are there. please help.

Thanks in advance.

hirentejani:
Hello every one i have Atmega328 ,Arduino UNO r3 board .when i power on and press reset switch pin 13 LED not toggle but continues on.And when i try to load firmware it give error avrdude: stk500_getsync(): not in sync: resp=0x00. i have found so many solution from other forum like uninstall driver and reinstall, 2)select proper COM ,3) select proper board , but i have not success yet, so Please any idea how i can resolve my problem . and is my board damaged,? when i try to load code on onther board it load success fully . so no driver or com problem are there. please help.

  1. What OS on PC?
  2. Has the UNO in question ever worked? Official/Clone?
  3. What other board works? Official/Clone?
  4. Have you tried another Windows PC?

If Windows, device manager show comm port enumeratedas COM3 .... COMnn. Using a terminal program, you can loop-back serial connection (Google it for specifics.)

Do not ask if the board is broken, all of the crystal balls have been lent. You will need to make the decision yourself, but giving specific and accurate background info will help us to help you decide if you whacked it or not.

Ray

hirentejani:
when i try to load firmware

What exactly do you mean by "load firmware" ?

Are you just trying to load a sketch?

Or something else? What?

...R

Thanks for reply mrburnette.

  1. i have windows Xp.
  2. and i have two arduino uno r3 board ,when i try to load sketch on second board it load sketch successfully.
  3. yes i have also try on another PC it not work.
    and my board not broken.

and first time by mistake i connect RX - TX to other shield and try to load sketch that was not successfully load yet and error are occur.

Thanks for reply Robin2
Firmware means sketch or Code. :slight_smile:

hirentejani:
Firmware means sketch or Code. :slight_smile:

The reason I asked is that I don't understand what that has got to do with the title of your Thread ???

...R