Use Arduino As An ISP Programmer
Use Arduino As An ISP Programmer
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Hardware Fun
Adding FUN to Hardware Programming and Electronics
Tweet
The answer is a denite yes and I use it all the time, since I have a lot of Arduinos lying
around. I thought of writing a tutorial, so that it will be useful for others who want to do this.
In this tutorial, I will show how you can program a non-Arduino AVR microcontroller like AtMega
16/16A using Arduino as an ISP programmer.
1/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
The next step is to nd the Arduino core support for the microcontroller you want to program and
then install it.
If you want program ATMega 16/16A, then you can use my Arduino extra core. I have also written a
separate tutorial explaining how to use it. Or if you want to program ATtiny microcontrollers, then
you can use the ATtiny core by David Mellis, one of the co-founders of Arduino.
Most of the time, you just have to place these core les inside /hardware directory in your sketchbook
folder, but consult the documentation of the actual core library you are using.
2/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Burn bootloader/fuse
The next step is to burn the bootloader or/and fuses. For most cores, you dont need to use the
bootloader.
My Arduino extra core doesnt need any bootloader, but only needs some fuses to be set.
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
3/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
You can burn the bootloader and/or the fuses, by selecting Tools -> Burn Bootloader. Make sure you
have chosen the correct board type before you do that.
Happy Hacking
This entry was posted in Tutorials and tagged Arduino, ATmega16, AVR, makele on October 13,
2013 [http://hardwarefun.com/tutorials/use-arduino-as-an-isp-programmer-to-program-nonarduino-avr-microcontrollers] .
davidhengo
October 15, 2013 at 11:01 PM
Hi Sudar, i followed the steps and i nally could upload my sketche, Thank you.
Do you know the reason why four of my new atmega16A chips dont work the digital pins
18,19,20,21 and PWM on D11?
Ive been trying to debug but still no conclusions.
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
4/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Best Regards.
Sudar
Post author
Not sure why you are not able to access the pins. Are you sure you are using the correct pins?
davidhengo
November 15, 2013 at 10:01 PM
ok, nally one of my chips worked correctly, its possible that the others were defective.
Thanks a lot.
Meraj
February 20, 2014 at 11:32 PM
thanks for making it easier to access avr controllers with arduino. I was able to burn bootloader
succesfully on atmega16l but cannot upload the sketches.The error shows:
avrdude: stk500_getsync(): not in sync: resp=0x00. It would be a privilege to have your assistance in
this problem.
Sudar
Post author
Meraj
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
5/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
I am programming via IDE and using a USB-UART cable to do the communication. The converter
consists of RX/TX/5v/3.3v/GND pins. Since there is no DTR pin for autoreset, I used a button to reset
manually at intervals during the upload. It worked for me with atmega328 but not with atmega16L. I
still have the issue on the term L which is low frequency,and arduino ide needs 16Mhz to work with.
Is there any way to rectify this problem?
Meraj
February 22, 2014 at 12:34 AM
It nally worked, I forgot to change the pin no. declaration in blink sketch. Thanks once again. I still
have problem on how to do serial communication via ide with atmega16l without using the arduino?
Sudar
Post author
Glad that you got it working. What is the exact issue that you are now facing while trying serial
communication?
Intex
March 9, 2014 at 5:55 AM
i would like to connect the RTC module with the Atmega16-16u microcontroller , could this be
possible ?
armin
March 16, 2014 at 9:36 PM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
6/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
could i use same instructions for atmega 32 , i see on google that pins are same
Sudar
Post author
3904
March 21, 2014 at 2:37 AM
Sudar
Post author
NicoHood
April 27, 2014 at 8:55 PM
Hey,
do you know if you can program the 16u4 from the arduino uno/mega with another uno? I have no
idea where i could nd a prole for this chip. I want to patch a hid function
Akki
June 2, 2014 at 11:14 PM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
7/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
hey there,
i have atmega 32A chip which i want to program using arduino uno. I have done the above steps. But
i am stuck at burning the bootloader. When I burn the bootloader, the arduino IDE says,
avrdude: Expected signature for ATMEGA16 is 1E 94 03
Double check chip, or use -F to override this check.
What could be possibly wrong?
Sudar
Post author
In the above article I am using Atmega 16 core. In your case you are using atmega 32A. So you
should a core that is compatible with atmega 32A, not my core which is only for atmega 16.
Akki
June 3, 2014 at 11:06 PM
Thanks.
Akki
June 3, 2014 at 11:25 PM
I got the core les for atmega32A . But got another problem now.
While burning bootloader, it says
avrdude: verication error, rst mismatch at byte 0x3891
0x != 0x3c
avrdude: verication error; content mismatch
Sudar
Post author
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
8/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Which core are you using? I get a feeling that the core is either outdated or there is a mismatch.
Akki
June 4, 2014 at 3:39 PM
Ok now nally burning the bootloader is done Now which type of program should i upload?
I have uploaded both arduino one and the atmega32 supported program but neither one is working.
Sudar
Post author
Which core are you using? Also refer to your core to make sure that you are using the proper pin
mapping.
Akki
June 4, 2014 at 3:43 PM
Akki
June 6, 2014 at 11:00 AM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
9/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
Can you enable verbose output and post the entire output?
Ojasvi Yadav
July 23, 2014 at 11:38 PM
The pin numbers in the standard pinout diagram of Atmega16 dont coincide with the actual pin
numbers required while programming. By Hit and trial i gured out that you need to name the pin
19 as 36 while programming. I mean, if youre programming and you are to use the pin 19 of
Atmega16, you must refer its location as 36, otherwise it doesnt work. Is there any direct list
available where all these actual pin numbers with their programming counterparts are listed?
Sudar
Post author
@Ojasvi,
Can you let me know pins by functionality instead of pin number? I dont have the datasheet handy
so I am not able to refer to nd out what pin 19 and 36 refer to.
Ojasvi Yadav
July 24, 2014 at 4:29 PM
When I type the program in Arduino IDE, I have to dene the pin name as 36 when I want to refer to
pin 19 on the Atmega16. Similarly, I have to write the pin name as 34 when i need to program any
input/output on the actual pin 17 of the Atmega16. Now these corresponding adjustments I gured
out by myself, but it would be very handy if there was a valid information as to what every pin
should be referred to as.
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
10/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Ojasvi Yadav
July 24, 2014 at 4:40 PM
Satish Pawar
July 28, 2014 at 7:53 PM
Hi sir,
I also followed your steps and tried to make my led blink. but got same error as Ojasvi got
please help..???
Johorey Ram
August 3, 2014 at 11:27 PM
How should one exactly dene the pins on atmega16 through the arduino IDE?
Moritz
September 29, 2014 at 8:41 PM
Flashing with an arduino pro mini (Mega328P) as an isp doesnt work for me
target is an ATMEGA16A, the ArduinoPro Mini gets ashed with the ISP Sketch then i disconnect
everything, wire up your isp connection add a led/resistor for LED blink test later
and a capacitor 10uF and 16V on the reset line and gnd of the promini
start the arduino suite, choose Tools-Board-Atmega 16
again tools install bootloader.
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
11/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
Jaison
October 15, 2014 at 5:09 PM
Hello,
This is my rst time programing a stand alone microcontroller. Could you please help me with basic
and getting started. I have ardiuno uno r3 i want to use it as isp n atmegs32A-pu . i have no clue to
where to start with.. Can someone save me?
paramveer panwar
December 13, 2014 at 10:21 PM
Sudar
Post author
Are you asking me how long it takes to reprogram atmega or how many time we can reprogram
atmega chips without destroying them?
For the rst question the answer is less than 30 seconds. For the second question I dont have an
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
12/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Nico
December 14, 2014 at 6:56 PM
suresh
January 9, 2015 at 7:41 AM
I have Arduino IDE 1.0.5-r2. You have mentioned in your write up your core doesnt work for this IDE
and you are working on it. Have you got the procedure /core for this IDE? I tried even though and as
expected it didnt work.My averdude.conf le does show signature of atmega16(0x1E 0x94 0x03) but
boards.txt doesnt list atmega16 board.All I could get were entries of atmega168 when I search the
le by atmega16.
I complement you for very nice write up and all the eorts you have put in.
Suresh
Sudar
Post author
Are you using Arduino 1.0.5 or 1.5.0? My core works with 1.0.x but not on 1.5.x since Arduino
changed the library format in 1.5.x
suresh
January 12, 2015 at 8:53 AM
I am using Arduino 1.0.5-r2. Wrongly I was under impression that I am using 1.5.0! After reading your
very prompt reply(many thanks for the same), I retraced my steps.Final error that is popping is the
following;
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
13/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
Hello Suresh,
Looks like you have not installed the core properly. Have you followed the instructions that I gave at
http://hardwarefun.com/tutorials/use-arduino-code-in-non-arduino-avr-microcontroller
Kindly verify it once more and if you are still facing the same error, then let me know briey how you
have installed it.
suresh
January 12, 2015 at 10:48 AM
14/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
USBDevice.attach();
#endif
setup();
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
return 0;
}
I cant why the error-undened ref to loop.
Many Thanks for your kind attention to my problem.
I am doing this at age(76 !) for appreciating what people (like you) are doing.
suresh
Sudar
Post author
Hello Suresh,
76! Wow! I wish to have the same amount of curiosity when I am your age
I think I found the reason why you are getting this error. As I mentioned in my other post
http://hardwarefun.com/tutorials/use-arduino-code-in-non-arduino-avr-microcontroller you should
NOT copy the arduino core into your arduino installation directory. Instead you should copy it into
your sketchbook folder directory.
Since you copied it to the arduino installation directly, I think it has overridden some of Arduinos
core les. I guess you may have to re-install Arduino to get back the correct les. After that install my
arduino-extra-core to the sketchbook folder and try it again. It should work after that.
Let me know if you are still facing any issues.
suresh
January 12, 2015 at 2:45 PM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
15/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
I have reinstall arduino 1.0.5-2r. I have copied core les,as suggested in your write up. There is just
one little doubt. I had placed another folder atiny in the folder -hardware inside sketch-folder.So it
looks like this:
C:\Documents and Settings\Suresh\My Documents\Arduino\hardware/atiny/ and
C:\Documents and Settings\Suresh\My Documents\Arduino\hardware/arduino-extra-cores-master/
circuit/atmega-16.fzz, atmega-16.png
variants/mega16/pins_arduino.h
boards.txt, Read.md
Am I on right track?
Should I try to upload Blinksketch, hoping I havenot made any error in connection?
suresh
Sudar
Post author
Everything seems to be ne. You can make one more change. Rename arduino-extra-cores-master
folder to arduino-extra-cores.
After doing this go to Tools -> Board menu and see if Atmega 16 is displayed in the list. If it is
displayed in the list then everything is installed properly and you should be able to use my extra core
without any issues.
suresh
January 13, 2015 at 7:35 AM
ooops! Blinking program doesnt show blinking even though uploading the sketech went through
without hitch.
I was confused with two dierent pictures in your write up
Ref: http://hardwarefun.com/tutorials/use-arduino-as-an-isp-programmer-to-program-non-arduinoavr-microcontrollers
There is a little dierence between two pictures-second and third picture.The second picture has a
capacitor between reset and ground and pin 31 of atmega16 is connected to ground.Third picture
doesnt have these.
I will try to upload without these two connections and hope those were the reasons.
Many thanks again
suresh
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
16/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
The capacitor is present in both the 2nd and 3rd picture. It is not very clear in the 3rd picture, but the
capacitor is there.
You can ignore pin 31 of atmega16 if you have connected the other pin to ground.
Are you using the blink sketch from the built-in example?
suresh
January 13, 2015 at 11:26 AM
Sudar
Post author
I am not sure if there is any major dierence between atmega 16A and atmega 16A PU.
Can you post a photo of your connection and also share the code of your blink sketch?
suresh
January 13, 2015 at 4:50 PM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
17/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
suresh
January 13, 2015 at 7:00 PM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
18/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
Which board are you using? It doesnt seem like a regular Arduino.
Also I am not sure if the capacitor is connected correctly. Kindly check it to make sure it is connected
correctly.
You have also loaded the Arduino ISP sketch into your Arduino before doing the connection right?
suresh
January 14, 2015 at 10:26 AM
I got this development from a local company EmbededMarket.com and assumed to be similar to
standard Uino board.
I magnied the image I had posted on my tablet.As it is it does give impression that capacitors
postive is not in line of black input. When I saw magnied image on he tablet, all wholes in the next
row of black input are visible;so it is not in the next row as unmagnied image gives the impression.
As regards the third query, yes I have uploaded ArduinoISP before connecting the circuit.
As my breadboard is rather old,I checked whether all external connections give continuity with the
corresponding pins of MC.
I am going to check all rest of MC pins have proper continuity with the rows, indicating that the
breadboard is not responsible
Well, if all these fails me,I will conclude that I might have spoiled MC with my tinkering around.
suresh
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
19/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
Sudar
Post author
suresh
January 23, 2015 at 1:55 PM
Nope.My wishful thinking is that the micro controller is good, circuit is correct.However micro
controller doesnt start for something wrong in fuses.I am getting no voltage on any pin except at
pin 10. I am curious to nd out whether one can read( may be averdude and?) registers of MC. I
have downloaded, installed averWin and trying to get hang of it.You can save my eorts by
informing that it is not feasible.
suresh
Sudar
Post author
I think it should be possible to read the registers of the MC using avrdude, but I am not sure.
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
20/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Dan
February 7, 2015 at 7:18 PM
Hey i tried your steps, yet i have been stuck in burning fuse! HELP me a bit..
avrdude: usbdev_open(): did not nd any USB device usb
After selecting proper board as well ii get the above error! Please help fast!
Dan
February 7, 2015 at 8:13 PM
Got the fault! Now working!!!How can i burn a hex le compiled in atmel studio for Atmega16 using
the same circuitry
Sudar
Post author
suresh
February 9, 2015 at 2:07 PM
Hi Mr.Sudar,
My study of avrdude commands is moving with snails pace.However yesterday I bootloaded using
Arduino uno board as ArduinoISP and Duemilanove as target board .My MC was Atmega328 -PU; as
per instructions I got avrdude.conf changed.I changed a signature for atmega328 to atmega328 -pu.
It did work.
Was the dierent signatures of atmega16 and atmega16A the cause for attempt failing?
I am little confused when you have writtenMy Arduino extra core doesnt need any bootloader, but
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
21/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
only needs some fuses to be set. How do we set these fuses, if needed, for loading the program?
To write fuses, I may have to use my new knowledge of avrdude commands otherwise.
Suresh
Sudar
Post author
Hello Suresh,
I was travelling so was not able to reply earlier.
If you are using Arduino as an ISP programmer then you dont need the bootloader. You have to
burn the fuses using the avrdude commands.
Let me know if you are still facing any issues.
Armia
February 13, 2015 at 11:49 AM
Hey Sudar
Thanks for your perfect description.
I programed my mega16 with Arduino Leonardo via IDE. The error is : avrdude: stk500_getsync():
not in sync: resp=0x00
Would you please help me ?
Thanks
suresh
February 13, 2015 at 2:25 PM
Dear Sudar,
My further search resulted in the following observations.
1. Signatures of Atmega16 and Atmega 16A are same.
2. Embedded Fuse Calculator gives dierent default Low fuse vales for these two MCs-(0xE1 and
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
22/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
0xc1 respectively.
3. board.txt le that is used to dene atmega16 by you shows this value as 0x84.
Another observation is that I could boot atmega328 using two development boards, Unio being host
and Durmilanove as target board. I then searched and found that Dumilanove board can be
replaced if one wants to bootload/program a avr micro controller, only that is needed to know SCK,
MISO, MOSI ,Reset. 5v and GND pins and such a board should be listed among the boards
denition.You have dened atmega16 board. Would dierent Low fuse values make dierent micro
controllers?
I would rst search on internet;otherwise I would change Low fuse value by avr command line
operation- I am getting to understand it.
Suresh
Sudar
Post author
You have dened atmega16 board. Would dierent Low fuse values make dierent micro
controllers?
I am sorry. I dont know about it. Are you able to get the fuse settings from the datasheeet?
Sudar
Post author
This error basically means that avrdude is not able to nd the device. Are you using the correct port?
Armia
February 14, 2015 at 10:13 PM
I dont know, everything seems to be correct. I also dened new pins & boards le for ATmega8 and
tried to program it, but again that error !!!
I also tried to program via Mega2560, but it didnt work. Again that error !
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
23/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
raju bhai
February 14, 2015 at 5:30 PM
thanx
thanx
thanx
thanx thanx
thanx thanx thanx thanx thanx thanx thanx thanx thanx thanx
Sudar
Post author
Armia
February 15, 2015 at 2:20 AM
Yeeeeees yohoooo
Finally worked!!!
Now I can sleep.
Thanks Sudar
Sudar
Post author
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
24/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Armia
February 16, 2015 at 10:08 PM
Hi Sudar
I was tinkering with dierent chips and noticed that I cant program fuse bits, even in mega16.
Can Arduino IDE program fuse bits?
Whats your suggestion about it?
Thanks alot
Sudar
Post author
You can use avrdude to change fuse bits. I don think it is possible to do it directly from Arduino IDE.
suresh
February 23, 2015 at 12:10 PM
Dear Sudar, Still coulnt x the problem. I have two questions,answers may help to remove diculty I
am facing.
1. It is not clear from your this tutorial whether you atmega on breadboard needs fuses and if so,
how to install them.
2. One is using two boards to select from TOOLS- one is atmega16(Internal 8MHZ clock ) and other
Uno).While programming atmega16, which port should be used?
My present knowledge(or NON-) indicates that the same set up can be used to read fuses, a
command like
C:\avrdude -c avrisp -p m16 -P COM3 -U lfuse:r:i
I expect to face the problem of unlocking fuse settings in order to read fuses. Search is on!
Suresh
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
25/26
3/3/2015
UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun
Sudar
Post author
Pooja Kose
March 1, 2015 at 9:33 AM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers
26/26