Programming ATmega8

Its been almost a month since I last visited the ATmega8 I bought the other day. Yet, there it was sitting nicely beneath my PC stand, a bit dusty though. With renewed interest and vigor, I rebooted my attempts. This time, I was ready with all the required components. I left you in the previous article stating that I wired up the programming circuit; but I failed to mention the circuit used. Without further ado, here’s my programmer circuit.

Click for a larger version

The circuit is simple and the costly parts are the ATmega8 itself and the DB25 connector. The capacitors connected with the crystal (22pF) are used to generate the clock waveforms for the microcontroller to operate. A slightly detailed explanation can be found here. The values of capacitor to be chosen are dependent on the frequency of Crystal. Most of the microcontrollers provide a look up table in their datasheet to select the capacitor value. Since our application is not terribly time critical, it is good enough if we use capacitors in the near vicinity.

Wire up the circuit on a bread board or a common, general purpose board depending on your choice. Take special care in connecting the ground pins of the parallel connector with the circuit ground. Failing to do this will result in unwanted signals and noise since the signals at two different referral levels are present in the board. With everything in place, it is always a good idea to recheck the wiring and make sure that parallel port connections stays intact.

As for the software part, there a lot of good tools out there to achieve the end job like avrdude, sp12 etc. But my favorite is uisp. If the hardware is all properly wired up, its time to see whether the software detects ATmega8. So fire up a terminal and type in

uisp -dprog=dapa

If all is well and working properly, you get a notification that

AVR ATmega8 detected

.
In the next post, we will cover programming with avr-gcc and burning with uisp

Related

Tags: ,

4 Responses to “Programming ATmega8”

  1. HopsOpegips Says:

    Stunning, I did not heard about this topic up to the present. Thanks.

  2. Jaan Says:

    The circuit seems to have one mistake. I put the 10K between Vcc and Atmega8 Reset, but parallel port pin 16 has to be wired to Atmega8 reset, not to Vcc directly. That how I got this circuit working.

  3. Rahul Pisharody Says:

    Jaan,
    That is strange. I’m pretty sure I wired up the circuit exactly as shown in the schematic. Let me confirm it. BTW, congratulations on making it work

  4. Jaan Says:

    I searched with Yahoo! “Programming the AVR microcontroller with GCC”, then opened 2nd link and “A small test project”. The Reset pin is wired differently and this change worked for me.

Leave a Reply