use arduino as an isp programmer

26
3/3/2015 Use Arduino as an ISP programmer to program nonArduino AVR microcontrollersHardware Fun | Hardware Fun http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 1/26 Tweet 0 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. The answer is a de䠴nite 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 make䠴le), 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

Upload: mekuannintmesfin

Post on 25-Sep-2015

172 views

Category:

Documents


9 download

DESCRIPTION

arduino as isp programmer - steps

TRANSCRIPT

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 1/26

    Tweet

    0

    Hardware FunAdding FUN to Hardware Programming and Electronics

    Use Arduino as an ISP programmer to programnon-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 toprogram these micro controllers, instead of using a separate dedicated AVR programmer.

    The answer is a denite yes and I use it all the time, since I have a lot of Arduinos lyingaround. 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 AtMega16/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 ArduinoIDE (or using my Arduino makele), then connect your Arduino to your computer and then uploadthe sketch to your Arduino.

    You should not connect anything else to your Arduino at this point and you will nd the Arduino ISPsketch in File -> Examples -> ArduinoISP

    Installing Arduino core for your microcontroller

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 2/26

    The next step is to nd the Arduino core support for the microcontroller you want to program andthen install it.

    If you want program ATMega 16/16A, then you can use my Arduino extra core. I have also written aseparate tutorial explaining how to use it. Or if you want to program ATtiny microcontrollers, thenyou 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 toconnect ATMega 16/16A. In general the principle remains the same for other micro controllers aswell.

    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)

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 3/26

    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 toReset pin)LED through proper resistor on any pin of the microcontroller, which you will be controllingthrough 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 thebootloader.

    My Arduino extra core doesnt need any bootloader, but only needs some fuses to be set.

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 4/26

    You can burn the bootloader and/or the fuses, by selecting Tools -> Burn Bootloader. Make sure youhave 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 ISPsketch 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 youcan use another Arduino as a bridge.

    Upload your sketch using makele

    My Arduino makele also supports uploading sketches through Arduino ISP programmer. Follow allthe 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-non-

    arduino-avr-microcontrollers] .

    78 thoughts on Use Arduino as an ISP programmer to program non-Arduino AVRmicrocontrollers

    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 pins18,19,20,21 and PWM on D11?

    Ive been trying to debug but still no conclusions.

    davidhengoOctober 15, 2013 at 11:01 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 5/26

    Best Regards.

    Not sure why you are not able to access the pins. Are you sure you are using the correct pins?

    ok, nally one of my chips worked correctly, its possible that the others were defective.

    Thanks a lot.

    SudarOctober 22, 2013 at 9:45 PM

    Post author

    davidhengoNovember 15, 2013 at 10:01 PM

    thanks for making it easier to access avr controllers with arduino. I was able to burn bootloadersuccesfully 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 inthis problem.

    Are you programming via the IDE or using the makele?

    MerajFebruary 20, 2014 at 11:32 PM

    SudarFebruary 21, 2014 at 10:31 AM

    Post author

    Meraj

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 6/26

    I am programming via IDE and using a USB-UART cable to do the communication. The converterconsists of RX/TX/5v/3.3v/GND pins. Since there is no DTR pin for autoreset, I used a button to resetmanually at intervals during the upload. It worked for me with atmega328 but not with atmega16L. Istill 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?

    It nally worked, I forgot to change the pin no. declaration in blink sketch. Thanks once again. I stillhave problem on how to do serial communication via ide with atmega16l without using the arduino?

    Glad that you got it working. What is the exact issue that you are now facing while trying serialcommunication?

    February 21, 2014 at 10:39 PM

    MerajFebruary 22, 2014 at 12:34 AM

    SudarFebruary 22, 2014 at 8:07 PM

    Post author

    i would like to connect the RTC module with the Atmega16-16u microcontroller , could this bepossible ?

    IntexMarch 9, 2014 at 5:55 AM

    arminMarch 16, 2014 at 9:36 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 7/26

    could i use same instructions for atmega 32 , i see on google that pins are same

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

    SudarMarch 20, 2014 at 11:40 PM

    Post author

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

    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?

    3904March 21, 2014 at 2:37 AM

    SudarMarch 21, 2014 at 4:40 AM

    Post author

    Hey,do you know if you can program the 16u4 from the arduino uno/mega with another uno? I have noidea where i could nd a prole for this chip. I want to patch a hid function

    NicoHoodApril 27, 2014 at 8:55 PM

    AkkiJune 2, 2014 at 11:14 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 8/26

    hey there,i have atmega 32A chip which i want to program using arduino uno. I have done the above steps. Buti am stuck at burning the bootloader. When I burn the bootloader, the arduino IDE says,avrdude: Expected signature for ATMEGA16 is 1E 94 03Double check chip, or use -F to override this check.

    What could be possibly wrong?

    In the above article I am using Atmega 16 core. In your case you are using atmega 32A. So youshould a core that is compatible with atmega 32A, not my core which is only for atmega 16.

    Thanks.

    I got the core les for atmega32A . But got another problem now.While burning bootloader, it saysavrdude: verication error, rst mismatch at byte 0x38910x != 0x3cavrdude: verication error; content mismatch

    SudarJune 3, 2014 at 10:10 AM

    Post author

    AkkiJune 3, 2014 at 11:06 PM

    AkkiJune 3, 2014 at 11:25 PM

    SudarJune 4, 2014 at 8:03 AM

    Post author

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 9/26

    Which core are you using? I get a feeling that the core is either outdated or there is a mismatch.

    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.

    Which core are you using? Also refer to your core to make sure that you are using the proper pinmapping.

    I got the core les from here

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

    When the code uploads, it gives an error:

    avrdude: verication error, rst mismatch at byte 0x00020x2a != 0x28avrdude: verication error; content mismatch

    AkkiJune 4, 2014 at 3:39 PM

    SudarJune 4, 2014 at 3:40 PM

    Post author

    AkkiJune 4, 2014 at 3:43 PM

    AkkiJune 6, 2014 at 11:00 AM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 10/26

    Can you enable verbose output and post the entire output?

    SudarJune 6, 2014 at 12:33 PM

    Post author

    The pin numbers in the standard pinout diagram of Atmega16 dont coincide with the actual pinnumbers required while programming. By Hit and trial i gured out that you need to name the pin19 as 36 while programming. I mean, if youre programming and you are to use the pin 19 ofAtmega16, you must refer its location as 36, otherwise it doesnt work. Is there any direct listavailable where all these actual pin numbers with their programming counterparts are listed?

    @Ojasvi,

    Can you let me know pins by functionality instead of pin number? I dont have the datasheet handyso I am not able to refer to nd out what pin 19 and 36 refer to.

    When I type the program in Arduino IDE, I have to dene the pin name as 36 when I want to refer topin 19 on the Atmega16. Similarly, I have to write the pin name as 34 when i need to program anyinput/output on the actual pin 17 of the Atmega16. Now these corresponding adjustments I guredout by myself, but it would be very handy if there was a valid information as to what every pinshould be referred to as.

    Ojasvi YadavJuly 23, 2014 at 11:38 PM

    SudarJuly 24, 2014 at 10:40 AM

    Post author

    Ojasvi YadavJuly 24, 2014 at 4:29 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 11/26

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

    Pin 19 and 17 are ADC pins

    Ojasvi YadavJuly 24, 2014 at 4:40 PM

    Hi sir,I also followed your steps and tried to make my led blink. but got same error as Ojasvi gotplease help..???

    Satish PawarJuly 28, 2014 at 7:53 PM

    How should one exactly dene the pins on atmega16 through the arduino IDE?

    Johorey RamAugust 3, 2014 at 11:27 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 disconnecteverything, wire up your isp connection add a led/resistor for LED blink test laterand a capacitor 10uF and 16V on the reset line and gnd of the proministart the arduino suite, choose Tools-Board-Atmega 16again tools install bootloader.

    MoritzSeptember 29, 2014 at 8:41 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 12/26

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

    Invalid device signature error

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

    SudarSeptember 30, 2014 at 4:40 PM

    Post author

    Hello,

    This is my rst time programing a stand alone microcontroller. Could you please help me with basicand getting started. I have ardiuno uno r3 i want to use it as isp n atmegs32A-pu . i have no clue towhere to start with.. Can someone save me?

    JaisonOctober 15, 2014 at 5:09 PM

    how much time we can re program atmega chip ?

    Are you asking me how long it takes to reprogram atmega or how many time we can reprogramatmega chips without destroying them?

    For the rst question the answer is less than 30 seconds. For the second question I dont have an

    paramveer panwarDecember 13, 2014 at 10:21 PM

    SudarDecember 14, 2014 at 6:54 PM

    Post author

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 13/26

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

    10,000 Times says the datasheet. So its enough

    NicoDecember 14, 2014 at 6:56 PM

    I have Arduino IDE 1.0.5-r2. You have mentioned in your write up your core doesnt work for this IDEand you are working on it. Have you got the procedure /core for this IDE? I tried even though and asexpected it didnt work.My averdude.conf le does show signature of atmega16(0x1E 0x94 0x03) butboards.txt doesnt list atmega16 board.All I could get were entries of atmega168 when I search thele by atmega16.I complement you for very nice write up and all the eorts you have put in.Suresh

    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 Arduinochanged the library format in 1.5.x

    sureshJanuary 9, 2015 at 7:41 AM

    SudarJanuary 9, 2015 at 11:12 AM

    Post author

    I am using Arduino 1.0.5-r2. Wrongly I was under impression that I am using 1.5.0! After reading yourvery prompt reply(many thanks for the same), I retraced my steps.Final error that is popping is thefollowing;

    sureshJanuary 12, 2015 at 8:53 AM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 14/26

    C;\Program Files \Ardunio1.0.5\hardware\arduino\cores\arduino/Arduino.h:213:26 :error :pins_arduino.h: No such le or directoryCan you please suggest remedy to ovecome this diculty?suresh

    Hello Suresh,

    Looks like you have not installed the core properly. Have you followed the instructions that I gave athttp://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 youhave installed it.

    Thats unbelievable! Your replied almost instantly.I did some search .There is a le in the folderC:\Program Files\Arduino1.0.5\hardware\arduino\cores\arduino, named Arduino.h ,created a thesame time I had installed your folder-arduino-extra-cores-master in the folder C:\ProgramFiles\Arduino1.0.5\hardware. I coied it in the same folder and named it pins_ardino.h and triedagain. Now I get the following error.C:\Program Files\Arduino1.0.5\hardware\arduino\cores\arduino/main.cpp:14: undened ref toloop I have copied the main.cpp and is given belowmain.cpp;

    #include

    int main(void){init();

    #if dened(USBCON)

    SudarJanuary 12, 2015 at 10:03 AM

    Post author

    sureshJanuary 12, 2015 at 10:48 AM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 15/26

    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

    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 shouldNOT copy the arduino core into your arduino installation directory. Instead you should copy it intoyour sketchbook folder directory.

    Since you copied it to the arduino installation directly, I think it has overridden some of Arduinoscore les. I guess you may have to re-install Arduino to get back the correct les. After that install myarduino-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.

    SudarJanuary 12, 2015 at 11:12 AM

    Post author

    sureshJanuary 12, 2015 at 2:45 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 16/26

    I have reinstall arduino 1.0.5-2r. I have copied core les,as suggested in your write up. There is justone little doubt. I had placed another folder atiny in the folder -hardware inside sketch-folder.So itlooks like this:C:\Documents and Settings\Suresh\My Documents\Arduino\hardware/atiny/ andC:\Documents and Settings\Suresh\My Documents\Arduino\hardware/arduino-extra-cores-master/circuit/atmega-16.fzz, atmega-16.pngvariants/mega16/pins_arduino.hboards.txt, Read.mdAm I on right track?Should I try to upload Blinksketch, hoping I havenot made any error in connection?suresh

    Everything seems to be ne. You can make one more change. Rename arduino-extra-cores-masterfolder to arduino-extra-cores.

    After doing this go to Tools -> Board menu and see if Atmega 16 is displayed in the list. If it isdisplayed in the list then everything is installed properly and you should be able to use my extra corewithout any issues.

    ooops! Blinking program doesnt show blinking even though uploading the sketech went throughwithout hitch.I was confused with two dierent pictures in your write upRef: http://hardwarefun.com/tutorials/use-arduino-as-an-isp-programmer-to-program-non-arduino-avr-microcontrollersThere is a little dierence between two pictures-second and third picture.The second picture has acapacitor between reset and ground and pin 31 of atmega16 is connected to ground.Third picturedoesnt have these.I will try to upload without these two connections and hope those were the reasons.Many thanks againsuresh

    SudarJanuary 12, 2015 at 3:31 PM

    Post author

    sureshJanuary 13, 2015 at 7:35 AM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 17/26

    The capacitor is present in both the 2nd and 3rd picture. It is not very clear in the 3rd picture, but thecapacitor 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?

    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 programgets uploaded without any error.Could PU extension be the culprit?suresh

    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?

    SudarJanuary 13, 2015 at 9:48 AM

    Post author

    sureshJanuary 13, 2015 at 11:26 AM

    SudarJanuary 13, 2015 at 12:00 PM

    Post author

    sureshJanuary 13, 2015 at 4:50 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 18/26

    Here is sktech,with required modication:/*BlinkTurns 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 seconddigitalWrite(led, LOW); // turn the LED o by making the voltage LOWdelay(1000); // wait for a second}Can you please let me know how to send the picture?suresh

    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/

    SudarJanuary 13, 2015 at 6:18 PM

    Post author

    sureshJanuary 13, 2015 at 7:00 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 19/26

    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 connectionssuresh

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

    You have also loaded the Arduino ISP sketch into your Arduino before doing the connection right?

    SudarJanuary 13, 2015 at 7:15 PM

    Post author

    I got this development from a local company EmbededMarket.com and assumed to be similar tostandard Uino board.I magnied the image I had posted on my tablet.As it is it does give impression that capacitorspostive is not in line of black input. When I saw magnied image on he tablet, all wholes in the nextrow 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 thecorresponding pins of MC.I am going to check all rest of MC pins have proper continuity with the rows, indicating that thebreadboard is not responsibleWell, if all these fails me,I will conclude that I might have spoiled MC with my tinkering around.suresh

    sureshJanuary 14, 2015 at 10:26 AM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 20/26

    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.

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

    Nope.My wishful thinking is that the micro controller is good, circuit is correct.However microcontroller doesnt start for something wrong in fuses.I am getting no voltage on any pin except atpin 10. I am curious to nd out whether one can read( may be averdude and?) registers of MC. Ihave downloaded, installed averWin and trying to get hang of it.You can save my eorts byinforming that it is not feasible.suresh

    I think it should be possible to read the registers of the MC using avrdude, but I am not sure.

    SudarJanuary 14, 2015 at 12:39 PM

    Post author

    SudarJanuary 23, 2015 at 10:25 AM

    Post author

    sureshJanuary 23, 2015 at 1:55 PM

    SudarJanuary 23, 2015 at 3:54 PM

    Post author

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 21/26

    Either way keep me updated about your progress.

    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 usbAfter selecting proper board as well ii get the above error! Please help fast!

    DanFebruary 7, 2015 at 7:18 PM

    Got the fault! Now working!!!How can i burn a hex le compiled in atmel studio for Atmega16 usingthe same circuitry

    Glad to know that you gured it out.

    DanFebruary 7, 2015 at 8:13 PM

    SudarFebruary 11, 2015 at 11:52 AM

    Post author

    Hi Mr.Sudar,My study of avrdude commands is moving with snails pace.However yesterday I bootloaded usingArduino uno board as ArduinoISP and Duemilanove as target board .My MC was Atmega328 -PU; asper 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

    sureshFebruary 9, 2015 at 2:07 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 22/26

    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

    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 toburn the fuses using the avrdude commands.

    Let me know if you are still facing any issues.

    SudarFebruary 11, 2015 at 11:55 AM

    Post author

    Hey SudarThanks 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

    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

    ArmiaFebruary 13, 2015 at 11:49 AM

    sureshFebruary 13, 2015 at 2:25 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 23/26

    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 hostand Durmilanove as target board. I then searched and found that Dumilanove board can bereplaced 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 boardsdenition.You have dened atmega16 board. Would dierent Low fuse values make dierent microcontrollers?I would rst search on internet;otherwise I would change Low fuse value by avr command lineoperation- I am getting to understand it.Suresh

    You have dened atmega16 board. Would dierent Low fuse values make dierent microcontrollers?

    I am sorry. I dont know about it. Are you able to get the fuse settings from the datasheeet?

    This error basically means that avrdude is not able to nd the device. Are you using the correct port?

    I dont know, everything seems to be correct. I also dened new pins & boards le for ATmega8 andtried to program it, but again that error !!!I also tried to program via Mega2560, but it didnt work. Again that error !

    SudarFebruary 14, 2015 at 6:30 PM

    Post author

    SudarFebruary 14, 2015 at 6:28 PM

    Post author

    ArmiaFebruary 14, 2015 at 10:13 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 24/26

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

    thanxthanxthanxthanx thanxthanx thanx thanx thanx thanx thanx thanx thanx thanx thanx

    Glad to know that you are so happy about it

    raju bhaiFebruary 14, 2015 at 5:30 PM

    SudarFebruary 14, 2015 at 6:27 PM

    Post author

    Yeeeeees yohooooFinally worked!!!Now I can sleep.Thanks Sudar

    ArmiaFebruary 15, 2015 at 2:20 AM

    SudarFebruary 15, 2015 at 6:41 PM

    Post author

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

    http://hardwarefun.com/tutorials/usearduinoasanispprogrammertoprogramnonarduinoavrmicrocontrollers 25/26

    Glad to know that you got it working

    Hi SudarI 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

    You can use avrdude to change fuse bits. I don think it is possible to do it directly from Arduino IDE.

    ArmiaFebruary 16, 2015 at 10:08 PM

    SudarFebruary 17, 2015 at 9:47 PM

    Post author

    Dear Sudar, Still coulnt x the problem. I have two questions,answers may help to remove diculty Iam 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 otherUno).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, acommand likeC:\avrdude -c avrisp -p m16 -P COM3 -U lfuse:r:iI expect to face the problem of unlocking fuse settings in order to read fuses. Search is on!Suresh

    sureshFebruary 23, 2015 at 12:10 PM

  • 3/3/2015 UseArduinoasanISPprogrammertoprogramnonArduinoAVRmicrocontrollersHardwareFun|HardwareFun

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

    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)

    SudarFebruary 23, 2015 at 9:12 PM

    Post author

    Im trying else thanks for this post..

    Pooja KoseMarch 1, 2015 at 9:33 AM