Sunteți pe pagina 1din 26

3/3/2015

UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

Hardware Fun
Adding FUN to Hardware Programming and Electronics

Use Arduino as an ISP programmer to program


non-Arduino AVR microcontrollers

After reading my recent tutorial on using Arduino code in non-Arduino microcontrollers,

one of my readers asked me if it is possible to use Arduino as an ISP programmer to


program these micro controllers, instead of using a separate dedicated AVR programmer.

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.

Loading Arduino ISP sketch


By default Arduino IDE comes with an ISP sketch. All you need to do is to open it up in your Arduino
IDE (or using my Arduino makele), then connect your Arduino to your computer and then upload
the sketch to your Arduino.
You should not connect anything else to your Arduino at this point and you will nd the Arduino ISP
sketch in File -> Examples -> ArduinoISP

Installing Arduino core for your microcontroller


http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

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.

Connect the circuit


The next step is to connect the microcontroller to your Arduino. The below diagram shows how to
connect ATMega 16/16A. In general the principle remains the same for other micro controllers as
well.

Program ATMega 16 using Arduino as ISP Programmer

The following are the dierent pin connections


Arduino Pin 13 to ATMega 16 Pin 8 (or SCK of another microcontroller)
Arduino Pin 12 to ATMega 16 Pin 7 (or MISO of another microcontroller)
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

2/26

3/3/2015

UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

Arduino Pin 11 to ATMega 16 Pin 6 (or MOSI of another microcontroller)


Arduino Pin 10 to ATMega 16 Pin 9 (or RESET of another microcontroller)
Arduino 5+ to ATMega 16 Pin 10 (or Vcc of another microcontroller)
Arduino Gnd to ATMega 16 Pin 11 (or Gnd of another microcontroller)
10 uF capacitor between Arduino Reset Pin and Gnd Pin (+ve leg of capacitor should go to
Reset pin)
LED through proper resistor on any pin of the microcontroller, which you will be controlling
through code
This is how my connection looks like

Program ATMega 16 using Arduino as ISP Programmer

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.

Upload your sketch


Now, everything is ready, and all you need to do is to write your sketch and then upload it. The ISP
sketch that your burned into your Arduino, will take care of the rest.
To use serial monitor, with your microcontroller, you can use my other tutorial which shows how you
can use another Arduino as a bridge.

Upload your sketch using makele


My Arduino makele also supports uploading sketches through Arduino ISP programmer. Follow all
the normal instructions and then dene ALTERNATE_CORE and ISP_PORT in your makele and run make
ispload target.

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] .

78 thoughts on Use Arduino as an ISP programmer to program non-Arduino 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

October 22, 2013 at 9:45 PM

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

February 21, 2014 at 10:31 AM

Are you programming via the IDE or using the makele?

Meraj
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

5/26

3/3/2015

UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

February 21, 2014 at 10:39 PM

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

February 22, 2014 at 8:07 PM

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

March 20, 2014 at 11:40 PM

Yes you can. Let me know if you face any issues.

3904
March 21, 2014 at 2:37 AM

how to link the REAL TIME CLOCK (rtc) with atmega 16 ?

Sudar

Post author

March 21, 2014 at 4:40 AM

I am not sure if I understand your question.


Can you explain what you are trying to do and what is the problem that you are facing?

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

June 3, 2014 at 10:10 AM

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

June 4, 2014 at 8:03 AM

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

June 4, 2014 at 3:40 PM

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

I got the core les from here


http://wiki.edwindertien.nl/doku.php?id=software:bootloaders#arduino_bootloader_for_atmega32

Akki
June 6, 2014 at 11:00 AM

When the code uploads, it gives an error:


avrdude: verication error, rst mismatch at byte 0x0002
0x2a != 0x28
avrdude: verication error; content mismatch

http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

9/26

3/3/2015

UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

Sudar

Post author

June 6, 2014 at 12:33 PM

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

July 24, 2014 at 10:40 AM

@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

Pin 19 and 17 are ADC pins

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?

Pingback: Use Arduino as an ISP programmer to program non-Arduino AVR microcontrollers |


techblog

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

Invalid device signature error

Sudar

Post author

September 30, 2014 at 4:40 PM

Are you able to ash if you use Arduino Uno as an ISP?

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?

Pingback: Fix Isp Programmer Error Windows XP, Vista, 7, 8 [Solved]

paramveer panwar
December 13, 2014 at 10:21 PM

how much time we can re program atmega chip ?

Sudar

Post author

December 14, 2014 at 6:54 PM

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

answer. You may have to check the datasheet of the chip.

Nico
December 14, 2014 at 6:56 PM

10,000 Times says the datasheet. So its enough

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

January 9, 2015 at 11:12 AM

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

C;\Program Files \Ardunio1.0.5\hardware\arduino\cores\arduino/Arduino.h:213:26 :error :


pins_arduino.h: No such le or directory
Can you please suggest remedy to ovecome this diculty?
suresh

Sudar

Post author

January 12, 2015 at 10:03 AM

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

Thats unbelievable! Your replied almost instantly.


I did some search .There is a le in the folder
C:\Program Files\Arduino1.0.5\hardware\arduino\cores\arduino, named Arduino.h ,created a the
same time I had installed your folder-arduino-extra-cores-master in the folder C:\Program
Files\Arduino1.0.5\hardware. I coied it in the same folder and named it pins_ardino.h and tried
again. Now I get the following error.
C:\Program Files\Arduino1.0.5\hardware\arduino\cores\arduino/main.cpp:14: undened ref to
loop
I have copied the main.cpp and is given below
main.cpp;
#include
int main(void)
{
init();
#if dened(USBCON)
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

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

January 12, 2015 at 11:12 AM

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

January 12, 2015 at 3:31 PM

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

January 13, 2015 at 9:48 AM

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

I am sorry to overlook capacitor in picture of your circuit.


I checked Blink sketch with another development board and it works on that board with atmega328.
I checked/rechecked the connections and I think it is just as has been explained /gien in the picture.
While checking the orientation of atmega16A, I noticed it is Atmega16A PU! However the program
gets uploaded without any error.Could PU extension be the culprit?
suresh

Sudar

Post author

January 13, 2015 at 12:00 PM

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

Here is sktech,with required modication:


/*
Blink
Turns on an LED on for one second, then o for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 20;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED o by making the voltage LOW
delay(1000); // wait for a second
}
Can you please let me know how to send the picture?
suresh

Sudar

Post author

January 13, 2015 at 6:18 PM

Your sketch seems to be ne.


If you use dropbox then you can get a url for your uploaded image and then can post it here.
Otherwise you can upload the image to services like http://picpaste.com/

suresh
January 13, 2015 at 7:00 PM
http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

18/26

3/3/2015

UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

Finally I succeeded getting a picture using tablet(!) and uploading it!


Here are details:
Picture url: http://picpaste.com/Atmega16Programming-FHgGfBpr.jpg
Deletelink: http://picpaste.com/del/uLXH0j42/Atmega16Programming-FHgGfBpr.jpg
No of days it would be kept is three.
I hope the photo is good enough for you to check the connections
suresh

Sudar

Post author

January 13, 2015 at 7:15 PM

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

January 14, 2015 at 12:39 PM

Sorry Suresh, I dont have any more suggestions


I suspect it could one of the following three issues, but dont have any concentre suggestions.
The board has some dierence with standard Uno board
Your IC is spolied
There is still some problem in the connection or the components that you are using.

Sudar

Post author

January 23, 2015 at 10:25 AM

Just curious. Were you able to get it to work?

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

January 23, 2015 at 3:54 PM

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

Either way keep me updated about your progress.

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

February 11, 2015 at 11:52 AM

Glad to know that you gured it out.

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

February 11, 2015 at 11:55 AM

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

February 14, 2015 at 6:30 PM

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

February 14, 2015 at 6:28 PM

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

I dont know whats wrong!


I uploaded ArduinoISP Sketch. Then I connected MISO to MISO, SCK to SCK, MOSI to MOSI, RESET to
RESET and 5V and GND and tried to program, but it didnt work.
What should I do ?

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

February 14, 2015 at 6:27 PM

Glad to know that you are so happy about it

Armia
February 15, 2015 at 2:20 AM

Yeeeeees yohoooo
Finally worked!!!
Now I can sleep.
Thanks Sudar

Sudar

Post author

February 15, 2015 at 6:41 PM

http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

24/26

3/3/2015

UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

Glad to know that you got it working

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

February 17, 2015 at 9:47 PM

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

February 23, 2015 at 9:12 PM

Here are my answers to your questions


1) Yes, you would require to burn fuses. For Atmega 16/16A if you choose Tools -> Burn Bootloader,
it will burn the fuses for you.
2) You need to choose Atmeta 16 (Internal 8MHz clock)

Pooja Kose
March 1, 2015 at 9:33 AM

Im trying else thanks for this post..

http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers

26/26

S-ar putea să vă placă și