Running the ATmega168

...so like me you've gone and got an ATmega168 from somewhere like http://www.sparkfun.com (which is where I get a lot of my stuff).  It probably cost you about £2.50. Obviously you'd like to get it to do something meaningful, so what do you need to do?  Take a look at this pinout for the processor:

Drop the processor into a breadboard, making sure that it straddles the middle row.  All we need to do is connect pins 1, 7 and 20 to a +5v DC supply and pins 8 and 22 to Ground.  That's all there is to it.  It's useful to note that the purpose of supplying power to pin 1 is to tell the microprocessor that it is not being reset.  Not supplying power to this pin will prevent any code from running, it will remain in reset mode.  We could use this pin like a reset button on a PC by adding a button and a resistor, but we won't worry about that right now.  I'm saying use a 5v supply because it's a nice easy voltage to find (for example, USB will supply 5v with 1A current, which is fine), but the processor should work with a supply between 2.7v and 5.5v (see the datasheet here if you're interested).  I often use a spare PC power supply, because they normally have a 5v output and are not expensive.

 

OK, so the processor may be running - but we've not put any code onto it yet.  So that's the next thing on our todo list.