

If you turn your power circuit on, the ATmega328 is now running, but it has nothing to run!Īctually this is not wholly true - there is one more connection that needs to be made before the ATmega328 starts running code. The ATmega328 should be in the breadboard, pin 7 (VCC) and pin 20 (AVCC) should be connected to your 5V rail and pins 8 and 22 (GND) should be connected to GND on your bread board. See image from the ATmega328 datasheet below. The pin numbers jump to the right side row of pins and count up. The orange arrow points at pin 1, and the blue labels show how the pin numbers increase.Ĭounting from the dimple, pin 1 is on the left and increases down the left side of the IC. The blue arrow in the picture is pointing to this dimple. For ICs, there is a small dimple on one end of the IC. The manufacturer of anything polarized (tantalum caps, electrolytic caps, LEDs, ICs, etc) will always put some sort of marking on the device to indicate the how the device is supposed to be oriented. Oh, hey! If no one ever told you, there is a really simple way to figure out where pin 1 is on an IC. You can connect the VCC pins on the ATmega328 to any holes along the 5V rail, and you connect the GND pins on the ATmega328 to any hole along the blue GND rail. One of these holes should be connected to the ground pin on your voltage regulator, and to the ground connection of your wall wart.

All the horizontal holes next to the blue line are connected together. This is true about the blue line as well. This will energize all the holes next to the red line with 5V. You should have a wire connecting your 5V power regulator circuit to one hole on the 5V rail. Note: The 5V 'rail' is the horizontal row of holes next to the red line. I find it best to to insert one side and then slightly push the IC sideways until the other side of pins can insert into the opposite row on the breadboard. The pins of the ATmega should insert into the inner two most rows on the breadboard. Be careful! Do not bend the pins too far inward. You will need to slightly bend in the legs of the DIP (dual inline package) to get the ATmega to straddle the breadboard center. Next, we need to insert the ATmega into the breadboard and connect up power and ground.ĪTmega8 (works the same with ATmega168, and 328) straddling the middle row of the breadboard I'm assuming you've got your 5V supply tested and working. You will find all ATmega328 information in the following pages, but the pictures will show an ATmega8. When these tutorials were written and photographed, we used the ATmega8.

A good quality multimeter with this setting goes for ~$60 and as high as $300 for a really spectacular one. We also highly recommend that you get a multimeter with a 'continuity' setting.

You can get all the parts for this lecture here.
