Step 4Using with avrdude
To test your your new atmega168 from commandline try:
$ avrdude -p m168 -P /dev/ttyUSB0 -c avrisp -b 19200
/dev/USB0 is the port that arduino is connected to my linux box (your's may be com5). This can be checked in arduino IDE in Tools -> Serial Port.
You should get:
[kabturek@hal-9000 ~]# avrdude -p m168 -P /dev/ttyUSB0 -c avrisp -b 19200
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.13s
avrdude: Device signature = 0x1e9406
avrdude: safemode: Fuses OK
avrdude done. Thank you.
That means everything is ok.
If you get errors - check the last step.
| « Previous Step | Download PDFView All Steps | Next Step » |









































Using a Pro Mini as the programmer and the Ardunio menu option to burn the bootloader I got an error.
avrdude: Expected signature for ATMEGA168 is 1E 94 06
Double check chip, or use -F to override this check.
I had to drop to a dos prompt and run the command by hand. I copied the hex file and conf file into the dir with avrdude to make things easy.
C:\>avrdude -p m168 -c avrisp -b 19200 -P com4 -F -U flash:w:ATmegaBOOT_168_diecimila.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x1e940b
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "ATmegaBOOT_168_diecimila.hex"
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: writing flash (16294 bytes):
Writing | ################################################## | 100% 2.50s
avrdude: 16294 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168_diecimila.hex:
avrdude: load data flash data from input file ATmegaBOOT_168_diecimila.hex:
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_168_diecimila.hex contains 16294 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 22.43s
avrdude: verifying ...
avrdude: 16294 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
I still need to test if it worked properly since I only have the pro-mini and some loose 168p chips.
By the way, I omited the external oscilator. So it's not mandatory for these chips.
avrdude -p m168 -c avrisp -b 19200 -P com4 -F -U lfuse:w:0xff:m -U hfuse:w:0xdd:m
If you don't burn any fuses your chip will run at 1mhz. You can tell because 1. The blink program will take 16 seconds to blink the light AND you can't program from the arduino IDE.
If you burn the wrong fuses, you can ruin your chip until you can get it into a high power (12v) programmer, so be sure before you burn fuses.