Thursday, May 1, 2008

Setting up the AVR

Before you can start with the fun, you have to get the AVR up and running. This isn't really difficult, since you only have to connect the supply voltage and ground, and then upload your program. Being a microcontroller, the AVR doesn't need any periphery.

Power supply
If you take a look at the data sheet, you will see that the ATMega8 accepts any value between 4.5 V and 5.5 V as supply voltage. This means you could either use a battery pack as power supply or build one using an LM7805 Voltage Regulator, which will provide a more stable 5 V supply voltage.

If you decide to build a power supply using the 7805, the only thing you have to do is connect the input voltage, which can be any value between 8V and 35V, between the input and the ground pin. Even though it will work on its own, I strongly recommend that you connect a diode between input and pin 1, a 1mF and a 100 nF capacitor between Pin 1 and ground, and a 1 µF capacitor between output and ground.

Having built your power supply, connect the output to the VCC pin of the AVR and tie the GND and AGND pins to ground. Connect a 1 kresistor between VCC and RESET to make sure that the AVR isn't in reset mode, if no programmer is connected.

If you don't feel up to building the power supply, you can always fall back on the battery pack, or purchase a power supply that delivers 5 volts DC and use it in this project.

Now you can connect your programmer to the AVR.

No comments: