Make a standalone Atmega8 circuit

Suppose u have an Arduino board, and  u want to run a code independently on another blank Atmega IC that u have (coz u dont wanna deploy ur UNO to some place where it doesnt need to b programmed again.. n a programmed IC cud fit d job well.. ).. then how do you go about the coding ?

Well according to the tutorials on the arduino site, as of now, u shudn have ny issues if ur board is not UNO ( => if ur board is older than that)  .. But now, Uno is becoming the more common arduino platform .. and I have a Uno too, so I tried to get my AtMega8 (a 28 pin DIP ) run by programming it through the UNO.. and it worked..  😀

So here is how u go about it..

On the left is my UNO with an Atmega328.

below is the atmega8 I extracted from an old avr board

Now, the steps in brief :

  • First of all, u need to burn a  bootloader on to the atmega8, using the Arduino as an ISP (its ok if u didn understand this.. 😉 )
  • Once the bootloader is uploaded, u can now upload a simple sketch like Led blink on the new IC, and check whether the program works by connecting the IC on the breadboard.
  • Once checked on the breadboard, u can now go happy-soldering on a pcb.

But the procedure is a bit tricky, so lets get the hands dirty ..

Step 1 :Upload ArduinoISP code on ur UNO

Connect ur UNO to ur PC via the USB cable and go to File -> Examples -> ArduinoISP and upload this sketch.

Step 2 :Burn the bootloader

Connect ur Atmega (Atmega8 in my case) to the UNO via a breadboard as shown.

So what u need is :

a 16 MHz crystal

                                        2 ceramic caps (18 pf or 22 pf or 33 pf)

a 10k ohms resistor

few jumper wires

and a breadboard.

( a better version of this cartoon is available at

  • Next, get an older version of the Arduino IDE (22 works & is available  at    (older IDE versions) ) Donno why it doesnt work with the new IDE..
  • then u burn the bootloader in 2 steps :
  • Step 1 : Select the board
  • Step 1: Select Arduino NG or older w/ Atmega8      Bcoz this board used Atmega8 and so the bootloader for Atmega8  would b selected.


  • The bootloader should be burnt in a minute..  When the screen says bootloader uploaded..   u r half way through the work! 🙂

Step 3 : Burn the Blink code on the new Atmega8

Pull off the Atmega328 out of ur UNO and plugin the Atmega8   (b careful about the pin mappings  (keep the notch side of the Atmega8 on the lower side of the UNO ) )

Now , go to       File – Examples – Basics – Blink

Then go to       Tools -Board – NG or older w/Atmega8

Click                Upload.

When the code is uploaded, u can check it right there as there is an LED on pin 13 of the UNO and it should start blinking by now..  🙂

Step 4 : Time for  breadboarding

The bare minimum connections required for an Atmega8 are as shown.

to this connect an LED + a 220 ohms resistor on pin 18 of the IC (it corresponds to dig pin 13 of the UNO ). Once done, it should start blinking.

If it blinks implies that ur power, reset and crystal circuit are alright..  🙂 Bravo!

Step5 & final : Solder ur circuit on a pcb..

In my case, I had to turn on a relay after some interval and the soldered circuit is as shown..

PCB soldered =)

Happy DIYing..   🙂

useful links on the web :


    1. Well, I havnt tried with a 12MHz crystal.. So r u trying to program it through a 12Mhz crystal or u want to run it on a 12MHz once its programmed ? I guess the settings should b stringent while programming.. but then after if u run on a lower MHz, it would just slow down the cycles accordngly… u cud give a try n lemme know . . 🙂 Gud luck!

  1. i have a 16mhz ceramic resonator however when i try it, it just makes my program frezze is it meant to do that or is something wrong i put a 0.22uf before the resonator connected to the ground and the rest looks the same can u plz help

    thank you

  2. thank you so much , I did it and its worked well

    small inquiry , when I uploaded program to ATmega 8 it’s take a lot of time to start work “8-10 sec”

    is that refer to bootloader ? how we can fix it ?

    1. Hey good to hear that you found smthing helpful here. 🙂
      Well, I too m facing the delay issue issue in the bootloaded Atmega8. Around 9 seconds or so.
      I think this issue shudn b der in the higher version of the IC, like the atmega128 or atmega328. U cud give it a try. I couldn find those, so had to work with the atmega8 only. Or probably you could order boot-loaded ICs [which may b a lil expensive than the other ones]
      But in case you application isnt time critical then probably, it wont be much of an issue.

      1. Hi nirzaree

        So it’s same issue

        not huge problem ,BTW, I’m so happy to do this .

        soon I will try upload program on atmega 8 By ICSP to elimination this delay “due to ICSP no bootloader needed” and I will tell you if it’s done

        thank you

  3. Hi, I just try it but its show :avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.
    I check all connections but doest help.. Im using Atmega8-16PU and now I noticed I got 12MHz, can it be problem?

    1. i am facing this problem too.. i got a AVR Dude and trying to burn a program into atmega8. but getting the same error. do you think it is a problem with 12MHz crystal??

  4. Description

    This is a Atmega8-16PU MCU preloaded with Arduino Optiboot (Arduino UNO) Bootloader.

    To use this MCU,simply

    Insert the following to the end of the boards.txt in Arduino\hardware\arduino Folder
    ############################################################## Optiboot-Atmega8-16

    1. plug it into a arduino UNO board and serve as a replacement for the old MCU OR
    2. supply this MCU with 5V and with a 16Mhz crystal, and use a USB>UART adapter to upload arudino sketch to the MCU ( eg FT232RL Adapter)

    Then select Arduino Optiboot-Atmega8-16 From the Tools>board menu
    Compile and Upload!

    Q: What is the difference with Atmega328 arduino Optiboot bootloader?
    A: This Atmega8-16PU was preload with official Optiboot bootloader compiled for Atmega8 (16Mhz). It does not have any difference in upload speed and MCU speed with Atmega328. The maximum sketch size is 7680bytes, but the price is half of that with Atmega328! So save money for projects with small size sketches!

    Package List:
    1. 3pcs ATmega8-16PU Lot Number 12+ (preloaded with arduino UNO bootloader)
    2. 3pcs 16Mhz DIP crystal

  5. not working for me… After about 30 secs while uploading the booloder… it says error while uploading boootloader.. Please help.. very urgent…

    1. avrdude: stk500_getsync(): not in sync: resp=0xe6
      avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x80
      this is the error

  6. Thank you for the great post! I’ve used your guide to successfully burn the bootloader onto six Atmega8-16PU’s.
    I also get the 9 second delay on boot but I don’t mind.

  7. Thanks for your tutorial. But it does not work for me. My controller is an ATmega8-16PU. The error is Yikes! Invalid device signature. However, when I replace the ATmega8-16PU by an ATmega328p it works fine (just modify the boards.txt). But I have some ATmega8-16PUs, I want to use them. How can I solve this problem?

      1. Yes, I am using the 16Mhz crystal. My IDE version is 0022. When I try to burn by using USBISP with progisp software, the problem is “Chip Enable Program Error”. And the prewritten Fuse: 0xD9E1. How do you think about the Fuse bit?

      2. Though its been quite a while since I played with Arduino & so I dont know about the changes in the newer IDE versions, I may still suggest u a few things to try out :

        1) u can give a try with the newer IDE versions, to check if the problem is due to the version of the IDE.

        2) Since the circuit works well with the atmega328s (hope that works still!), I dont think there are connection issues. I did not do ny changes in the fuse bits, so I dont think if that could be an issue. What changes have u made to the board.txt file?

        Since the circuit is pretty simple, I dont think of other things that could go wrong.

  8. I did everything perfectly. My program worked well on board but when i detached atmega8 from board and placed it on a breadboard it didn’t work at all. I checked the circuit many times but couldn’t get any response. I am programming an LCD. Any help would be appreciated.

    1. Well, when you have an elaborate wiring in the circuit, breadboards aren’t reliable. Some loose connection may keep u wondering for a long while.
      If u can do it on a PCB, it would be better.

  9. Hi,
    It was a great tutorial (simple to follow), i tried the same with Atmega8A-PU, but i got the error
    Arduino: 1.5.5 (Windows XP), Board: “Arduino NG or older, ATmega168”

    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.

    my question is do we need to connect the 16Mhz Crystal ckt on Atmega8A-PU while burning the boot loader ? i am using 022 ver IDE

  10. Hay Man ! Thanks-A-Lot ………..

    It worked with the latest AtMega8A (previous was Atmega8) …………………It will be very helpful for me in future to off-board in cost effective way ………

    You Did Really Good,

    Internet is great because of some (or maybe many) helpful people like you are out there, helping as a fellow human on some other corner of the world, not expecting power, money or anything else in return !

    And indeed “Life in a Verb not a Noun”
    Good luck to you !

  11. Please i need help, when i have follow all steps in order, but i get this error : avrdude: stk500_recv(): programmer is not responding. I have a mac OS

  12. Hi

    Tanks for you tutorial. It helped a lot.
    But I get the same error as “saqib”

    It works perfectly on the board, but on the breadboard it doesnt. I also tried a standalone circuit (on a PCB) made for my Atmega328p (the conections are the same right?!) and it doesnt work too. 😦

    I wonder whats happening. If you could help id be glad.

    1. Hello Daniel,

      Usually breadboards aren’t that reliable when u put components like crystals; so I would definitely suggest making a small circuit board. But as I read, it doesn’t work on a pcb for you?
      It is a pretty simple circuit. Just the power and clock connections for the chip. Can u put a snapshot of your circuitry?

      All the best!

  13. I am using ATmega8A-PU, while burning the bootloader it throws an error “Arduino: 1.6.0 (Windows 8), Board: “Arduino NG or older, ATmega8”

    “efuse” memory type not defined for part “ATmega8”
    Error while burning bootloader.

    This report would have more information with
    “Show verbose output during compilation”
    enabled in File > Preferences.

  14. hello. i m doing a major project on at mega 8. i couldnt configure the problem with the development board… do i need to use oscillator in at mega 8?

Leave a Reply to Sufian Kaki Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.