Introduction: Compact ATMega 8 Programming Tool

A lot of people are using the latest microcontrollers on the market, but the old ones can often offer cheaper alternatives. They may be less powerful, but are sufficient and they usually consume less power.

One of these very interesting old controllers is the ATMega 8. It's very cheap and offers 23 I/O pins.

How to upload a bootloader and a program in it is very well explained in this instructable

But in my case,I didn't need to have a bootloader in the microcontroller, so I just built a device to program the ATMega using an Arduino nano as ISP. It's very similar to what I did for ATTiny85 .


Supplies

Components :

  • 1 Arduino nano
  • 1 70x50mm prototyping board
  • 1 16MHz crystal oscillator
  • 2 22pf capacitors
  • 1 10kOhm resistor
  • 1 ZIF IC socket ( at least 28 pins... )
  • some connectors
  • some wires

Step 1: Schematic

I just took the circuit explained in this instructable and built it with an Arduino nano.

Step 2: Let's Do It !

I tried various positions for the components before choosing one. Then connected the whole, ant it as time from wrapping and soldering.

Front face is OK. Rear face is always spaghetti like.

Step 3: Let's Try It : Program Upload

On your Arduino IDE, you will need to install the Minicore board manager, just follow the instructions here :

https://github.com/MCUdude/MiniCore#how-to-install


Set the board to ATMega8, the frequency to 16MHz ( unless you chose an other quartz frequency ), the programmer to "Arduino as ISP", and the Bootloader to "No Bootloader".


Here is a simple blink program for port D13


#define LED_PORT 13
void setup() {
pinMode(LED_PORT , OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_PORT , HIGH);
delay(1000);
digitalWrite(LED_PORT , LOW);
delay(1000);
}


You need to use the "Upload using Programmer" command instead of the standard "upload".

Step 4: Final Touches

I added some labels just in case I don't remember how to use this device in the future.

And I added a layer of epoxy resin to reinforce the whole.

Step 5: Enjoy !

One of the advantages of using an ATMega8 is to be able to debug your code on a standard Arduino, and then upload it to an ATMega8.

For simple applications, it will be fully compatible.