Wednesday 27 April 2016

Using atmega 8 in Arduino IDE

This post is important since atmega 328p is way more expensive than atmega 8a. We can use arduino IDE with atmega 8 too.

Open arduino IDE and from file menu select Examples>Basics>Blink.
In next instance, code for blinking a led will be displayed on your screen.

Now from Tools>Board>Arduino NG or older

Arduino ng or older
Selecting arduino ng or older

Now, we have to choose microcontroller:
Tools>Processor>Atmega 8

Selecting atmega8 from processor
Selecting atmega 8
Now, we have to just compile the program.
Just click on the first icon just below the file menu.
compile the code
Compiling the code
Also, make some changes in preferences: File>Preferences
Arduino preferences
Preferences
Make changes as given above. This make the IDE more user-friendly.
Note: Preferences has nothing to do with programming part. It just makes IDE more user-friendly.

Now, our hex file is generated. One question arises: How to locate the hex file?

First of all, click on view to display hidden files and folders:
hidden files and folders
View hidden files and folders
After this, hidden files and folders will appear:
You can retrieve hex file from the following directory:

C:\Users\user_name\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp

In this folder, resides your hex file. Check the date and time of hex file.

I am using avrdudes for burning the hex file in atmega 8a.

Fuse byes are as follows: Low fuse: 0xE4
                                         High fuse: 0xC6
This setting is for 8-MHz internal oscilltor.

Note: Wrong fuse bytes can damage your microcontroller.
The delay of arduino IDE is not in sync with your coding due to indifference in crystal oscillator.

Thanks for your patience.

Keep supporting !!




No comments:

Post a Comment