0% found this document useful (0 votes)
281 views8 pages

ATmega8 As Arduino Using Internal 8Mhz Crystal

This instructable teaches how to use an ATmega8 microcontroller chip to store and run Arduino code, acting as a compact and inexpensive alternative to an Arduino board. It requires an ATmega8 chip, a 10uF capacitor, jumper wires, a breadboard, and an Arduino board. The Arduino is programmed as an ISP to burn the bootloader onto the ATmega8. The boards.txt file is modified to add support for the ATmega8 configuration. Sketches can then be uploaded to the ATmega8 through the Arduino ISP. Converting the ATmega8 allows creating smaller, cheaper projects than using an Arduino board.

Uploaded by

victor Ajah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
281 views8 pages

ATmega8 As Arduino Using Internal 8Mhz Crystal

This instructable teaches how to use an ATmega8 microcontroller chip to store and run Arduino code, acting as a compact and inexpensive alternative to an Arduino board. It requires an ATmega8 chip, a 10uF capacitor, jumper wires, a breadboard, and an Arduino board. The Arduino is programmed as an ISP to burn the bootloader onto the ATmega8. The boards.txt file is modified to add support for the ATmega8 configuration. Sketches can then be uploaded to the ATmega8 through the Arduino ISP. Converting the ATmega8 allows creating smaller, cheaper projects than using an Arduino board.

Uploaded by

victor Ajah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

instructables

ATmega8 As Arduino (using Internal 8Mhz Crystal)

by UtkarshVerma

Nowadays, gadgets like Arduino have found a very depend on the usage of an external crystal oscillator
popular use. They can be used to create a plethora of to achieve the same goal, this project uses the
projects, however, they occupy a lot of space and are internal 8Mhz crystal of ATmega8, which makes it a
expensive for some of us (including me). To solve this boon for those who lack the 16Mhz crystal.
problem, I present to you this instructable, which will
teach you how to use an ATmega8 (or any other avr) Also, I will be using an Arduino as an ISP to
chip to store Arduino code and act as a compact and program the chip, so this makes it more cheap.
cheap Arduino. Doing this requires easily available
electronics, which, if you are a hobbyist too, will Now, without further ado, let's begin tinkering!
already have. Unlike other instructables, which

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 1


Step 1: Gather Around Some Stuff and Some Files

Requirements:
1. 10uF capacitor - 1
Stuff To Download:
2. Male to Male Jumper Wires - 8 1. Bootloader for ATmega8

3. Breadboard - 1 2. Arduino IDE v1.0.1

4. ATmega8 chip - 1 This link will lead you to the Arduino IDE Downloads
page. Download the v.1.0.1 specifically because I
5. Arduino UNO or any other Arduino have found it to work perfectly with the ATmega8

chip. For some reason, latest version doesn't support 5. Boards.txt


the modification of Boards.txt, which is crucial for this
instructable. The usage of this file will be explained afterwards.

Step 2: Converting Arduino Into a Programmer

Arduino can be converted into a programmer by simply uploading the ArduinoISP sketch to it. It is provided as an
example sketch by Arduino. However, I am providing the code as a file too. Download it and upload it to your
Arduino.

Once the code is uploaded, proceed to the next step.

Download
http://www.instructables.com/ORIG/FK3/U5M6/J1CEU1CZ/FK3U5M6J1CEU1CZ.ino

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 2


Step 3: Setting Up Arduino V1.0.1

After downloading Arduino v1.0.1, extract it. Also, 3. Now open "arduino.exe" placed in the extracted
copy the whole text of "boards.txt" file you Arduino 1.0.1 folder.
downloaded.
4. Select the Arduino board as "ATmega8-noxtal
1. Now you have to browse the following file in the @8MHz"
extracted folder:
5. Select the Programmer as "Arduino as ISP"
"........\arduino-1.0.1\hardware\arduino\boards.txt"
Now your Arduino IDE v1.0.1 is set up!
2. Open "boards.txt" and paste the copied text at the
end of the file.

Step 4: Hooking Up Arduino With ATmega8

Wire the ATmega8 IC with your Arduino by referring to the above posted schematics.

Also, keep in mind to place the 10uF capacitor between the RESET and GND pins.

I have attached a picture of how I had wired my Arduino to ATmega8.

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 3


Step 5: Burning the Bootloader to ATmega8

Bootloaders are the files which enable a 3. Check if the Programmer, COM Port and Board is
microcontroller to be programmed independently. correctly set as described in one of the previous
Therefore, once ATmega8 is burnt with a bootloader, steps.
we will be able to use it as an Arduino.
4. Hit "Burn Bootloader" under "Tools" menu.
To burn the bootloader:
1. Extract "atmega8_noxtal.zip" to ".......\arduino- If you have wired correctly, on clicking the "Burn
1.0.1\hardware\arduino\bootloaders\". Bootloader" option, the RX,TX, and L lights on the
Arduino will start glowing brightly. I have posted the
2. If Arduino IDE is already running, restart it, else picture too.
open it.

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 4


Step 6: Uploading Sketches to ATmega8

After burning the bootloader to your ATmega8, you burn the bootloader is also used for uploading
have almost finished this project. sketches.

Now all that's left to do is to upload your desired Uploading the sketch is done by using Arduino as a
sketch to your chip. To do that, ensure that the board programmer, so unlike usually, when you pressed
is set to "Atmega8-noxtal @8Mhz", and the "Ctrl+U", now you will have to press "Ctrl+Shift+U",
programmer to "Arduino as ISP". which tells the IDE to program the chip through
Arduino.
Remember that the wiring which you had used to

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 5


Step 7: Congratulations!

Congratulations on successfully converting your That's all for this instructable! If you have any doubt,
ATmega8 chip into a mini Arduino. Now you can feel free to comment.
make your projects much more compact and cheap.
To understand its pin relation with Arduino pins, refer Keep Tinkering!
to the "ATmega8 as Arduino Pinout" file which you
had downloaded earlier. Project By:

Also, if you found this instructable helpful, please Utkarsh Verma


support me by reopening the shortened download
links twice or thrice. You can also support me on Thanks to Ashish Choudhary for lending his
Patreon. camera.

https://www.youtube.com/watch?v=Er_DKLqc-m8

it was soo tough


Hi, I am having an error (or warning maybe) : avrdude: stk500_getsync(): not in sync: resp=0x66.
Please help...
This error is shown by the IDE when there's a connection issue with the Arduino. Ensure whether
your Arduino is properly connected by doing loopback test and try again.
Thank you, I had a problem in my cable.
Now I am experiencing a new problem. I am having a huge level of noise while taking input though
analog pin(ADC0). Meanwhile, in Arduino, I am getting the actual input. I searched the internet and
found a solution to remove noise (as they said, getting a noise in analog input without this setup is
general). I applied this, but no result.
For you information, I am using audio signal as input.
Can you please help me...

I'm sorry to say I won't be of any help to you regarding this matter since I haven't tried out Arduino's
analog pins yet and don't have the time to do so currently. So you'll have to look it up yourself.
I have the error ?
avrdude: Expected signature for ATMEGA8 is 1E 93 07
ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 6
Double check chip, or use -F to override this check.
I had the same problem.
solved when I've unplugged the LED from pin PB5 or Digital13 and ground
This error happens when your Board isn't correctly set in Arduino IDE.

Then what to do next? I am getting same error..


Correct your board settings by re-doing Step 3.

TNX @UtkarshVerma
it worked! simple and perfect.
I really needed it.

This is for all! If your ATmega8 has a misconfigured clock fuse which is set to 16MHz, refer to this
instructable to burn the bootloader properly.
https://www.instructables.com/id/Burning-Bootloaders-Into-AVRs-Using-Arduino/
i born program to mega 8 and ather mega with out arduino- directly inside arduino ide
but i cand find way to burn bootloader to-bootloadr dont born i dont know way
just you need
YS-38-USBasp : https://www.ebay.com/itm/USB-ISP-USBASP-Programmer-for-ATMEL-AVR-51-
ATMega-ATTiny-ATMEGA8-ATMEGA128-/151004354206

or other type aruino ide suported programer


use :
https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json

for change crystal frequesy clock internal ixternal atmega-bod-


video :
https://youtu.be/hwbwKVKUF50

Glad to know it worked out for you. I see you're using Arduino v1.8.5. I'd suggest using older
Arduino IDE v1.0.1 since I had issues with modifying the boards.txt file in newer versions. Also, I
can't understand most of what you're saying.
hi
ibuy
Arduino Uno Rev3
and DEV-11168
-----------------------------
http://shop.aftabrayaneh.com/AVR_ISP_Shield_Arduino_Atmega328p_Bootloader_DEV_11168__AFTAB.html?
search=%D8%B4%DB%8C%D9%84%D8%AF%20%D9%BE%D8%B1%D9%88%DA%AF%D8%B1%D8%A7%D9%

--------------------------
but i stil canot burn bootloader
I can't say anything about the AVR ISP Shield since the website doesn't provide its schematic.

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 7


Also, try the process as shown in this Instructable. If it isn't working then you might be missing
something.
By the way, did you buy ATmega8 without bootloader or with a bootloader? Also, does your
Arduino have removable IC or not?
tank you i will buy isp programmer and cheek it agin

No need to buy ISP. You can use Arduino as an ISP as shown in Step 2

i dont have arduino

it work with mega 8 smd to? my chip is smd i thing that my priblem

Firstly, I'd like to enlighten you that there's no difference between the SMD and DIP versions of any
IC rather than the size.
Therefore this method will with for you too. Just recheck the stated steps.
Also ensure that the clock fuse is not set to 16MHz because if it is, then you'll have to add an
external 16MHz crystal oscillator between the OSC pins to make your chip boot up.
Also, tell me the specific part where you are failing with this process.
*With=work

if i program mega 8 with ATmegaBOOT.hex


work without isp programer?
You will need the programmer for sending data into the chip.

Error while uploading: missing 'upload.tool' configuration parameter

Haven't ever got this error. But I think you should check if your board is properly set by re-doing
Step 3.
Thanks for sharing. I use the same method on some of my projects.

A while back, I mistakenly ordered some ATMEGA8 chips, instead of ATMEGA328p's. Although
this chip does not have as much memory as the ATMEGA328p, it still works perfectly for projects
that does not need all that memory.

Here is one of my ATMEGA8 projects:


https://www.instructables.com/id/7-Segment-UpDown-...

ATmega8 As Arduino (using Internal 8Mhz Crystal): Page 8

You might also like