Guide: How to use an Arduino as an In System Programmer (ISP)

Thanks for replay.

Now I explain my steps:

  • I am using Arduino Mega 2560;
  • Arduino software 0.22;
  • upload sketch 'ArduinoISP';
  • connect a ATmega8 with breadboard (for test) to Arduino with single wire for: reset (pin 10 Arduino, pin 1 ATmega8), MOSI (pin 11 Arduino, pin 17 ATmega8), MISO (pin 12 Arduino, pin 18 ATmega 8), SCK (pin 13 Arduino, pin 19 ATmega8), also connect VCC and GND;
  • put 120 ohm resistor between VCC and reset Arduino;
  • in console mode I digit: 'avrdude -p m8 -P com5 -c avrisp -b 19200';
  • result: avrdude: stk500_getsync(): not in sync: resp=0x00.

What do I worng?

Many thanks for your support.

Enrico.

I looks like that you havn't disabled auto reset properly :slight_smile:
Try with a 110 ohm resistor instead. You could also cut the trace labeled "RESET-EN", see http://arduino.cc/en/Main/ArduinoBoardMega2560 at the "Automatic (Software) Reset section".

Regards
Lauszus

I tried your indications.

With 110 ohm resistor:
avrdude.exe: stk500_getsync(): not in sync: resp=0x00

Then I cut the trace labeled "RESET-EN", without resistor (first time):
avrdude.exe: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude.exe: initialization failed, rc=-1

  • Double check connections and try again, or use -F to override*
  • this check.*
    avrdude.exe: stk500_disable(): protocol error, expect=0x14, resp=0x51

With cutted, without resistor (others times):
avrdude.exe: stk500_getsync(): not in sync: resp=0x00
avrdude.exe: stk500_disable(): protocol error, expect=0x14, resp=0x51

Bye.
Enrico.

Hmm, that's weird.
Are you sure you have connected everything to the atmega8? Like all ground connections, VCC and a crystal (if you are using that).

Regards
Lauszus

Hello.
I tried to replace the card with another Arduino Mega 2560 and also the ATmega8 chip.
I'm using version 0.23 of the IDE.
AVRDUDE used is provided with the IDE.
I also added the crystal.

But the result is always the same.

You can see photo of the installation.

Hi,

You should install avrdude separately and not use the one bundled with the Arduino software - I have seen other people having problems with the bundled one as well.

I recommend downloading either WinAVR: http://winavr.sourceforge.net/ if you are running Windows or CrossPack: http://www.obdev.at/products/crosspack/index.html if you use MAC OS X. As they include all you will ever need like: a compiler (avr-gcc), programmer (avrdude), and debugger (avr-gdb) plus more.
You can also just download avrdude seperatly: AVR Downloader/UploaDEr - Summary [Savannah], but I can't see the point, as WinAVR and CrossPack is just way faster to get installed.

Hope that did the trick :slight_smile:

Regards
Lauszus

Thank you very much, but:
I downloaded WinAVR, type 'avrdude -p m8 -P com4 -c avrisp -b 19200' in C:\WinAVR-20100110\bin directory, and result is:
avrdude.exe: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude.exe: initialization failed, rc=-1

  • Double check connections and try again, or use -F to override*
  • this check.*
    avrdude.exe: stk500_disable(): protocol error, expect=0x14, resp=0x51

I downloaded avrdude-5.11-Patch7610-win32, but the result is the same.

The problem could be the bootloader?

Enrico.

Hmm, are you sure that you have connected it the right way? See this post for more info: USBtiny-based AVR Programmer FAQ
Also take a look at this old thread, where people are discussing some of the errors you get: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248528012/all

Regards
Lauszus

Hello.
I found a oscilloscope and checked Arduino pins (10,11,12,13):
they don't move when I type 'avrdude -p m8 -P com4 -c avrisp -b 19200'.

What it means?

Enrico.

Are you sure com4 is the correct port? Also try to use "-c arduino" instead if "-c avrisp".

Regards
Lauszus

Hi Lauszus, com4 is correct, IDE Serial Port is com4 (upload ArduinoISP Sketch) and when type "avrdude -p m8 -P com4 -c avrisp -b 19200" RX and TX leds in Arduino Mega 2560 blinking.

I used "-c arduino" instead of "-c avrisp", avrdude return:
avrdude.exe: stk500_getsync(): not in sync: resp=0x00

But with "-c arduino" instead of "-c avrisp" pin 13 (SCK) goes high for about 300 ms.

Regards.
Enrico.

Hi Lauszus,
After many attempts I tried to use Arduino UNO.
At the first shot it's worked.

I thank you for your support, I don't know why Mega 2560 doesn't work.

Enrico.

Hi,
Nice :slight_smile: Glad I could help.

Regards
Lauszus

hi lauzsuz,
i have questions:

  1. can i have program my at89s52 with tis isp concept
  2. where i find avrdude program (or we program our chip over arduino)
    3)how we connect our chip to arduino uno?

where i find avrdude program (or we program our chip over arduino)

It is in the Arduino distribution, on my PC - C:\Program Files (x86)\arduino-0022\hardware\tools\avr\bin -

@mahk

  1. can i have program my at89s52 with tis isp concept

It seems like a lot of people have tried to port it, but it's still not supported in avrdude, so I don't think it will be that easy.
Here is a example of a old post I found: http://old.nabble.com/How-to-add-AT89S52-to-avrdude-support-list--td24198268.html

  1. where i find avrdude program (or we program our chip over arduino)

It's much easier to just download WinAVR (http://winavr.sourceforge.net/) or CrossPack (CrossPack - A Development Environment for Atmel’s AVR Microcontrollers) as you will also get the newest version of avrdude.

3)how we connect our chip to arduino uno?

Check the datasheet for your chip and connect MOSI, MISO and SCK to pin 11 (MOSI), 12 (MISO) and 13 (SCK) on your Arduino. Then connect pin 10 (Slave select or just SS) on your Arduino to the reset pin of your chip.

Regards
Lauszus

Hi all!

I had the same problem - avrdude.exe: stk500_getsync(): not in sync: resp=0x00
If someone still need a solution, Try next: "avrdude -p m328p -P //./COM5 -c avrisp -b 19200"
It helps me. Good luck!

So I bought the Graphic LCD Serial Backpack (SparkFun Graphic LCD Serial Backpack - LCD-09352 - SparkFun Electronics) and I'm trying to upload a updated firmware to add the needed flow control from http://serialglcd.sourceforge.net/ I have read through the comments and came across this forum. I also found a comment that the file being over sized and a solution here Google Code Archive - Long-term storage for Google Code Project Hosting. . It was also commented to use Mega ISP Arduino Playground - MegaISP

Where I'm stuck is step 5. I never used WinAVR. Can someone explain step 5. Which program is doing the compiling and which file is being compiled? I downloaded the serialGLCD1.62 files and there are a bunch of files inside.

"5) Compile the program to make a hex file, this can be done by typing "make all" in a terminal while inside the folder (use "cd" and then the path to the folder - see step 11 for help)
You might have to change some setting for it to work. If there is already an hex file (as in my example) you can just skip this step"

So far I have the following filles
serialGLCD1.62
ArduinoISP-dev04b

And the following programs
Arduino programmer
WinAVR

Hardware I'm using
Graphic LCD 128x64 https://www.sparkfun.com/products/710
Graphic LCD Serial Backpack SparkFun Graphic LCD Serial Backpack - LCD-09352 - SparkFun Electronics
Pocket AVR Programmer https://www.sparkfun.com/products/9825

Thanks in advance

P.S.
Should I follow this forum's tutorial or the sparkfun one here (Serial Graphic LCD Hookup - SparkFun Learn) ? Is one newer? Can the sparkfun be applied to any firmware?

P.S.S Has sparkfun actually updated the firmware from the original? Do i need to still update it?

@Yigiter007
Try to follow this guide: AVR Tutorial - Software setup for Windows. This might help you get it compiled.

I have no idea if Sparkfun has updated their firmware. I haven't tried the serial backpack since I wrote this guide, so I have no idea.