Silly Rabbit, Clocks are for Kids
This is (like all of them) a long dormant project I'm attempting to restart.
Parts: Evil Mad Scientist ATmegaXX8 Target Board Business Card [[1]] ATmega168 microcontroller [[2]] 22 picofarad capacitors (2 of em) [[3]] Other stuff that's in the little heart box.
Oh look! and Sparkfun has just the tutorial (maybe) I'm looking for [[4]]. Or not.
(0) Install AVRDude for use with a USBTinyISP AVR programmer
See http://www.ladyada.net/make/usbtinyisp/avrdude.html
Actually try this http://www.ladyada.net/learn/avr/setup-mac.html
(0a) Start with Objective Development's CrossPack (previously AVR MacPack) http://www.obdev.at/products/crosspack/download.html
(0b) Make a Demo project. Check out the default code. At the command line:
Per the CrossPack recommendation set CrossPack to use gcc 3
> avr-gcc-select 3
Make a Demo project
> avr-project Demo
This will make a bunch of code from template. Check it out!
> cd Demo/firmware
> view main.c
The default main.c "is configured for an ATMega8 with internal RC oscillator at 8 MHz." (from [[5]]
(0c) There is no 'c'. AVRDude comes as part of Objective Developments CrossPack. Yer done.
Next, you need to hook up to a hardware development environment and confirm it works. Time to order a USBTinyISP AVR Programmer.
(1) set fuses After you get the AVR programmer working, then figure out how to set the fuses and what to set them to. Check the datasheet for the ATmega168 to sort out what and how to set the fuses.
(2) place capacitors appropriately
This is Raf: "22 picofarad seems to work for every crystal. They give you all these guidelines and 22 picofarads seem to always work anyway."
The crystal goes in xtl1 and xtl2. Direction don't matter. 22 pF capacitor goes from one crystal lead to ground, the other from the other crystal lead to ground.
Not yet soldered photo is at <my phone still>