Arduino As ISP || Burn Hex File in AVR || Fuse in AVR || Arduino As Programmer

Introduction: Arduino As ISP || Burn Hex File in AVR || Fuse in AVR || Arduino As Programmer

About: i believe to help people and share my knowledge i always want to build creative thing some of them for learning and some of them is very useful.

...........................

Please SUBSCRIBE To my YouTube channel for more videos........

This article is all about arduino as isp.

If you want to upload hex file or if you want to set your fuse in AVR then you no need to buy a programmer, you can do it with arduino.

In this article i have uploaded hex file in atmega8 if you want to upload hex file in other AVR then understand the process and follow same steps.

........................

Step 1: Requirements

  1. Arduino uno
  2. Some jumper wires
  3. Breadboard
  4. Crystal oscillator (optional if your controller is set on external oscillator)

*** if your controller is out of the box then no need to connect Crystal oscillator this ****

Step 2: Connect Arduino With Pc

  • Connect your arduino with PC
  • Open arduino IDE and click on tools
  • Then click on board, here select arduino uno
  • Now click on port below board, here select port where arduino is connected.

***** my arduino is connected on COM2, remember your we will use it later.

Step 3: Upload Code

  • Go to the file then examples
  • Find ArduinoISP example
  • Upload ArduinoISP program
  • Now go in tools and select programmer "arduino as isp"

Don't confuse about arduino isp and arduino as isp in programmer.

Step 4: Connect Circuit

  • Here we burn Hex file and set fuse in Atmega8. Please understand the concept so you can burn hex file in any type of avr via arduino.
  • Connect the circuit as given in photo.
  • Crystal oscillator is optional if your Avr is set on external fuse, if AVR is out of the box then no need to connect this.

Step 5: Pin Out Understanding

  • As you can see in first photo there is MISO, MOSI AND SCK pin, which we will connect to the respectively 13,12,11 pin of arduino.
  • As you can see in second photo there is Reset pin which we will connect to the 10th pin of arduino.
  • In third photo you can see VCC, AVCC and GND pin, connect AVCC and VCC to 5v of arduino, GND to GND of arduino.

Step 6: Download the Zip File

  • Download the zip file given below
  • Extract the zip file

Mirror Github :

https://codeload.github.com/vishalsoniindia/Arduin...

Step 7: Find Your Controller Code

Paste your Hex file in same folder which we have downloaded, where you can see cmd.txt file.

  • Open cmd.txt file in folder
  • Copy first line which is "avrdude -c arduino -b 19200 -p xyz"
  • Type cmd at the top bar of your pc as shown in photo.
  • Here command terminal is opened
  • Paste your line and hit enter
  • In last photo you can see controlled name and controller code mine is m8 for atmega8.

Step 8: Detect Controlled

  • Copy second line in taxt file which is "avrdude -c arduino -b 19200 -p m8 -P COM2 -n"
  • Paste it in command terminal
  • Now change your com port mine is COM2 where your arduino is connected.
  • Change your controller code mine is m8.
  • Hit enter.
  • When you see some device signature and fuse ok it means your controller is detected.

Step 9: Set Fuse

  • Copy this line which is "avrdude -c arduino -b 19200 -p m8 -P COM2 -U lfuse:w:0xE2:m -U hfuse:w:0xD9:m"
  • Past it in command terminal.
  • Now change your com port mine is COM2 where your arduino is connected.
  • Change your controller code mine is m8.
  • This fuse is set on internal 8MHZ, it means you no need to connect external Crystal oscillator.
  • Hit enter.
  • Now fuse is set it is one time process no need to to next time.

If you want to change fuse then E2 is lower fuse and D9 is higher fuse, you can change it according to your requirements.

Step 10: Upload Hex File

    Before this paste your hex file in same folder, where you can see cmd.txt file.

  • Copy last line and paste it in command terminal.
  • At the last of line you can see file name, replace it with your hex file name.
  • Now change your com port mine is COM2 where your arduino is connected.

  • Change your controller code mine is m8.

  • Hit enter.

  • If you see same massage as in my third photo then your hex file is burned in AVR.

....ALL DONE....... HO HO HO..

Be the First to Share

    Recommendations

    • Halloween Contest

      Halloween Contest
    • Tinkercad Student Design Contest

      Tinkercad Student Design Contest
    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge

    20 Comments

    0
    arafathossain.369741258
    arafathossain.369741258

    Question 5 months ago on Step 7

    help please. "xyz file not found" it's problem face. this problem solutions please...

    IMG_20210323_225443.jpgIMG_20210323_110840.jpg
    0
    vishalsoniindia
    vishalsoniindia

    Answer 5 months ago

    This is not a problem.
    Did you seen my video i clearly said why or read Step 7,
    If you ask already written things then people will be irritate, please ask me when you really stuck in problem,
    Watch full video and read whole Instructable.
    This xyz give you list of controller code below see your controller code and replace it with xyz, mine is m8 for atmega 8

    0
    arafathossain.369741258
    arafathossain.369741258

    Question 5 months ago on Step 4

    If programming internal oscillator. So do I need to use extra oscillator when burn files?

    thnq....

    0
    vishalsoniindia
    vishalsoniindia

    Answer 5 months ago

    If you already set it to internal oscillator then no need to add external crystal

    0
    arafathossain.369741258
    arafathossain.369741258

    Question 5 months ago on Step 10

    The file I want to burn, change the name of the file in place of the hex file name change?

    example, my burn hex file name "sun detect.hex "

    so,name change write,"sun detect.hex ""

    plz hlp me .

    and you known Bangla language ?

    0
    vishalsoniindia
    vishalsoniindia

    Answer 5 months ago

    Yes,
    You have to change name and com port as well.
    No bangali but can speak hindi and English

    0
    navbert85
    navbert85

    Question 9 months ago on Step 10

    y para leer el archivo hexadecimal en ves de grabarlo como se le aria???

    0
    vishalsoniindia
    vishalsoniindia

    Answer 8 months ago

    Can you just type in English please?

    0
    navbert85
    navbert85

    Reply 8 months ago

    and to read the hexadecimal file instead of saving it as it would be ??

    0
    vishalsoniindia
    vishalsoniindia

    Reply 8 months ago

    Not understand yet. I already translated it.
    Please write your sentences with proper line end and dots so it can translate perfectly

    0
    dave.ramsey
    dave.ramsey

    Question 9 months ago

    Hi Vishal, trying to burn bootloader on to AT90Can128. But not achieving a result. Can you assist. Dave

    0
    vishalsoniindia
    vishalsoniindia

    Answer 8 months ago

    Yes, how you are doing this please explain

    0
    vishalsoniindia
    vishalsoniindia

    Reply 8 months ago

    Ok looks like there is issue with programmer or with controller...
    First detect your controller as i show in tutorial.... Then let me know results

    0
    expertpk1
    expertpk1

    Question 11 months ago on Step 2

    what the different .hex files contain?

    0
    vishalsoniindia
    vishalsoniindia

    Answer 11 months ago

    There is different hex files according to the specification of controller... Like Attiny has different pin out from atmega328p...
    And fuse settings are also different... If we burn different fuse in different controllers then it might be get dead.... To generate hex file according to your controller..... If you are using arduino ide click on binary file to get hex file of code..

    0
    expertpk1
    expertpk1

    Reply 11 months ago

    OK
    Your answer is right.

    As I am new to microcontroller programming so I asked this question.

    Actually I wanted to know something else.

    A 4x4x4 Led Cube Project by Tom which is charliplexed was created on ATtiny84 Chip. Tom has published the source code as Embedded C for AVR.

    My question is does simply Burning the hex file after compiling the code will be able to run the project as stand alone chip?
    Do we not need bootloader to start the chip after power on?
    OR the Compiled code itself contains the bootloader?

    I am not clear about these processes:
    bootloader
    our code compiled in AVR Studio
    and
    how to make a Microcontroller run our code stand alone?

    Also please let me know your EmailID , if you can, so that I can contact directly.

    Thanks for your early reply and I again appericiate the same.

    Pradip Kumar

    0
    vishalsoniindia
    vishalsoniindia

    Reply 8 months ago

    Let's understand it simple.... Bootloader do 2 things 1st it set fuse and make microcontroller programmable via rx tx.... Which happens in arduino....

    So if you are programming it via spi no need of bootloader... Just set fuse if you not want to go with default fuse.... If you upload hex file which not match with fuse of controller then it runs perfect, only time delay will increases or decrease.... Means if your code is blink it blinks fast or slow.... Depending upload fuse

    0
    Jijesh K P
    Jijesh K P

    9 months ago

    Can we use the "hex file without bootlader"
    Obtained from Arduino ide after compiling the sketch , inorder to program standalone atmega chip through this method?

    0
    vishalsoniindia
    vishalsoniindia

    Reply 9 months ago

    Yes you can upload it without bootloader but you have to set fuse if your code depend upon fuse.... Otherwise if your code is simple like blink or input outputs then upload it directly