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.
I need to remember to remove the chip from the Arduino board.