Step 5OR internal-oscillator board build
- Breadboard
- ATmega168 chip
- .1uf capacitor (ceramic, polyester, etc. doesn't matter so much; value .047uf-.47uf should be fine)
- 10K resistor (values ~3.3k-20k should work fine)
- Short lengths of wire
Program the Bootloader with your AVR programmer:
You will want to use the lilypad bootloader (included in with release Arduino-0010, in the hardware/bootloaders/lilypad). Using your AVR programmer, flash the bootloader. For example, on my OSX system:
cd /Applications/Arduino-0010/hardware/bootloaders/lilypad
PATH=${PATH}:/Applications/Arduino-0010/hardware/tools/avr/bin
avrdude -C /Applications/Arduino-0010/hardware/tools/avr/etc/avrdude.conf -cusbtiny -pm168 -Pusb -e -u -Ulock:w:0x3f:m
avrdude -C /Applications/Arduino-0010/hardware/tools/avr/etc/avrdude.conf -c usbtiny -pm168 -Pusb -Uflash:w:LilyPadBOOT_168.hex -Ulock:w:0x0f:m
avrdude -C /Applications/Arduino-0010/hardware/tools/avr/etc/avrdude.conf -cusbtiny -pm168 -Pusb -e -u -Uefuse:w:0x00:m -Uhfuse:w:0xdd:m -Ulfuse:w:0xf2:m
Set up the breadboard:
Put the ATmega168 in the breadboard, straddling the center.
For each of the following connections, use the hole at each ATmega168 pin that is the closest to the chip that is open; this will leave the last hole in each of the rows 1-8 open for the programming cable to plug into.
Connect pin 7 and 20 with a length of wire (VCC to AVCC)
Connect pin 8 and 22 with a length of wire (GND to AGND)
Connect the 10K resistor from pin 1 to pin 7 (RES to VCC) *
Connect the .1uf capacitor from pin 7 to pin 8
If you have power bus lines on your breadboard, I suggest connecting the + rail (red) to pin 20 and the - rail (blue) to pin 22. This is somewhat bad form (connecting to the analog side for power connections for other stuff), but if your breadboard is the same size as mine you've already filled all of the holes available for pin 7.
If you're planning to use USB power, you can now just plug in the programming cable and upload sketches to the board (make sure to connect the power selection pins on the cable adapter with a jumper to power the chip from USB).
Otherwise you'll need to use a battery/voltage regulator/etc. to supply power. Note that you will want to always use 5v for programming via Arduino software; other voltages will cause the clock speed to vary significantly and will likely cause communication (and thus programming) to fail.
When you go to upload sketches to this style of board that uses the internal oscillator, select "Lilypad Arduino" from the Tools/Board menu.
- 2008 10-02 FIXED -- was incorrectly put as pin 1 to pin 10 in original
| « Previous Step | Download PDFView All Steps | Next Step » |











































thank you for the response. I am trying to build a Lilypad with theATMega 168.
I am drawn to make one because it involves a minimum number ofparts and can be quite small. I make toys, so the smaller theelectronics the better. I was wondering if you could give me some clueson wire it and also how to bootload it. Since all the surface mountATMega 168 do not seam to come bootloaded already.
THanks so much!!!
arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf
(note that you can find schematics & eagle pcb files for thestandard arduino boards on the arduino site).
For bootloading you'll need a programmer -- e.g. the USBtinyISP (fromAdaFruit) or the AVRISPmk II which you can get from e.g. mouser.com) --I prefer the mk II just because i've had reliability issues with thetinyUSB in certain situations. with current arduino software,loading the bootloader is easy, pretty much just hooking the programmerto the ICSP connector, powering the board and clicking the "burnbootloader" selection from the arduino software (under"Tools"). You'll have to select the board type beforeyou do so to make sure it gets the right bootloader.
Is this the same chip as the one in the mini arduino. Would I be able to get the surface mount parts and wire the ATMega168 (square one)the same way? please let me know.
thanks!
generally a good idea when laying out a board with an AVR to also add an in-circuit programming header. seewww.atmel.com/dyn/resources/prod_documents/DOC0943.PDF for the pinout on the standard connector. you can pretty much jump ahead and look at figure 2