2011-01-08

A note of caution for Arduino ISP

I'm making Arduino-compatible devices. Firstly, I made a minimal circuit in accordance with this document: Circuit (targeting an AVR on a breadboard). For making Arduino, I needed to prepare chips burned Arduino bootloader. So I tried to burn Arduino bootloader onto two chips: ATmega 8 and ATmega 168p with Arduino ISP.

But there were some troubles. My development environment is Arduino Duemilanove and Arduino 0022 on Mac.


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


I tried to burn Arduino bootloader onto ATmega 8. I chose [Arduino NG or older w/ ATmega8] in [Tools]-[Board] and clicked [w/ Arduino as ISP] in [Tools]-[Burn bootloader]. But it failed with a error message: "avrdude: stk500_getsync(): not in sync: resp=0x15".

This error is because of Auto Reset capabilities of Arduino. This document: MegaISP gave me some details. This error occurs on Mac or Linux. For using Arduino as ISP, I need to disable Auto Reset capabilities. Therefore I inserted 110 ohms (330 ohms / 3) resistor between Reset-pin and 5V-pin. This resistor should be above 110 ohms and below 124 in accordance with this document: DisablingAutoResetOnSerialConnection.

I tried to burn Arduino bootloader onth ATmega 8 again and succeeded in it. I connected 19 pin of ATmega 8 and GND with a LED and it flashed. This behavior proves buring Arduino bootloader in accordance with this document: Bootloader.

avrdude: Expected signature for ATMEGA168 is 1E 94 06


I continuously tried to burn Arduino bootloader onto ATmega 168p. I chose [Arduino Diecimila, Duemilanove, or Nano w/ ATmega168] in [Tools]-[Board] and clicked [w/ Arduino as ISP] in [Tools]-[Burn bootloader]. But it failed with a error message: "avrdude: Expected signature for ATMEGA168 is 1E 94 06".

This error is bevause of arvdude in Arduino development environment (Arduino.app). arvdude in Arduino.app refers to /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf. There is m168 section (for ATmega 168) but there is not m168p section (for ATmega 168p) in this avrdude.conf.

So I found avrdude.conf including m168p section with Google. And I used arvdude in Terminal for burning Arduino bootloader onth ATmega 168p.

$ cd /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/bootloaders/atmega
  # there are bootloader files for ATmega168/328.
$ AVR=/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr
  # root directory for AVR tools
$ $AVR/bin/avrdude -C /tmp/avrdude.conf -p m168p -P /dev/tty.usbserial-A7006SSA -c avrisp -b 19200 -U flash:w:ATmegaBOOT_168_diecimila.hex
  # maybe -F is needed before -U

I checked the success of burning bootloader with LED and 19 pin.

upload scketch


I need to remember to remove the chip from the Arduino board.

Thanks.

12 comments:

  1. Thanks for this excellent article . I need to bootload an "Atmega168 20pu" i hade the "avrdude: stk500_getsync(): not in sync: resp=0x15" which i have solved by adding the 110 ohnm resistor.
    Now i get the following message.
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.
    Can you help me ?
    Thanks

    ReplyDelete
  2. There is a similar issue > http://code.google.com/p/mega-isp/issues/detail?id=2 .

    At first, the chip may be inferior. In this case you need to exchange it for another one or use -F option.

    Second, the circuit may be wrong. For example, you need to use 16hz oscillator for Arduino-compatible circuit.

    ReplyDelete
  3. i have the 16mhz oscillator and the circuit is correct :S

    ReplyDelete
  4. Thank you so much for posting this - I did a lot of googling when I ran into this problem, and this was the only thing I found that really explained it. I even saw those pages on the Arduino site before finding this, but since it was for the MegaISP I didn't read too deeply into it. Dropped in a 120ohm resistor and it worked perfectly!

    ReplyDelete
  5. Yes! Thank you for the post! This was the only article I found that explained why the bootloader would not burn. Nobody on the forums said anything about the auto reset needing to be disabled!! They need to update the arduino official tutorial page to include this key piece of info!!

    ReplyDelete
  6. Hi,
    Thanks for your article, I had the "avrdude: stk500_getsync(): not in sync: resp=0x15" error while trying to burn Arduino bootloader into a 328 with an Arduino 2009.
    The 3 resistors tip fixed the problem.

    ReplyDelete
  7. I tried to add more pull resistors to fix that error but it didn't seem to work (i'm using 6 680ohm in parallel)

    ReplyDelete
  8. HI
    THANKS YAAR. for me 120 omhs worked , i was struggling with this issue for past two days . >> YOU'RE * OUTSTANDING * EXCELLENT * GREAT *
    * GOOD * WELL DONE * REMARKABLE * keep going ..
    -pragdhees : India

    ReplyDelete
  9. Thanks a lot! Struggled with the same problem (couldn't load to tiny85, got "avrdude: stk500_getsync(): not in sync: resp=0x15". Both 120 ohms to +5 or 10uF to ground on RESET successfully defeated auto-reset and I could burn my '85 happily. Sent a note to D Mellis to try to get the HLT wiki updated that Duemilanove needs auto-reset disabled too.

    ReplyDelete
  10. trustfm, had same problem as you did and found a fix here-http://arduino.cc/forum/index.php/topic,58670.msg421987.html#msg421987

    ReplyDelete
  11. Thanks a lot!, Terima kasih banyak (bahasa Indonesia), my problem is solved

    ReplyDelete
  12. I have had this same problem trying to program a 328 with a nano. I had a 10k resistor (as described everywhere) used a 10uF capacitor (to earth) which works for Attiny's.

    Anyway this all happened while using the IDE 22. when I went to 1.0 there was no more problem

    ReplyDelete