Introduction: How to Upload C Code to ِAVR Using Arduino Uno As Programmer

About: biomedical engineer

HI everyone :D

Here I will share a simple way to program any AVR chip using Arduino Uno R3

All you need to burn the code to your microcontroller is Arduino Uno instead of buying specific programmer which cost a lot.


You will need:

  1. Arduino uno r3 with removable chip (1)
  2. Jumper wires
  3. 10uF electrolyte capacitor (1)
  4. Hex file generated from your C code

Step 1: Arduino ISP

First: open your Arduino IDE and upload Arduino ISP into your Arduino

you can find it in File -> Examples

Before pressing upload key you need to check the Board type and COM port.

NOTE: this code will turn your Arduino to a programmer!

Step 2: Find the Datasheet for Your AVR and Check the Pin Out

Pin 1 is the pin that have a small dot near it

we need (VCC, GND, Reset, UCSK , MISO , MOSI) locate them in your AVR.

Step 3: Connect Arduino to AVR

connect Arduino to AVR according to the Figure and your AVR datasheet

and don't forget to connect a 10uF capacitor between GND an RST of your Arduino for disabling the auto reset of Arduino

Step 4: Get Your Fuse Setting and AVRDUDE APP

go to

and select your AVR, mine is Atmega16

I won't change anything so I don't destroy my AVR, but I will change the internal RC to 8 MHZ "You can choose external 16 MHZ crystal" it's up to you.

scroll down and copy avrdude argument

to paste it into AVRDUDE programe.

mine is

-U lfuse:w:0xe4:m -U hfuse:w:0x99:m

AVEDUDE download link:

then open it and change the settings like the image and depending on your hardware and don't forget to paste the fuse settings into Additional command line args

Step 5: Get Your HEX File From Your C Code

I will write a simple c code to blink a LED in PIN 20

upload hex file to avrdude in Flash section and hit program

Step 6: The End

For any question comment down below