ArduinoISP not Working

I'm trying to use arduinoISP to install a bootloader on a 1284p without much success.

However for repeatability, I have performed the details below using a 328p

ISP Board - Arduino diecimila atmega168
Target Board - Arduino diecimila atmega328p

Arduino IDE 1.0 for macosx
arduinoisp.ino from GitHub - rsbohn/ArduinoISP: Use the Arduino to program AVR chips.

1 - Program the ISP board bootloader using usbtinyISP

tools->board->arduino deicimila w/ ATmega 168
tools->programmer->usbtinyISP
tools->burn bootloader

Debug / verbose output /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude - Pastebin.com
This leads to a board with pulsing pin13 LED

2 - Program ISP board with ArduinoISP

Download ArduinoISP.ino from github as above
Open in arduinoIDE
Verify - output /Applications/Arduino.app/Contents/Resources/Java/hardware/t - Pastebin.com
Upload - http://pastebin.com/9Z1jasCu

3 - Connect target board to ISP Board.

Connections as per http://arduino.cc/en/uploads/Tutorial/arduinoisp.png

4 - Program targetboard bootloader

tools->board->arduino duelimnova w atmega328
tools->programmer->arduino as isp
tools->burn bootloader

this leads to "Error while loading bootloader" full output here /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude - Pastebin.com

I believe this to be down to the autoreset of the diecimila, adding a 110ohm resistor between 5v and reset on the ISP board, repeating the programming step I now get

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega168 -cstk500v1 -P/dev/tty.usbserial-A4001l0H -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x00:m -Uhfuse:w:0xdd:m -Ulfuse:w:0xff:m 

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/swp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A4001l0H
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

ArduinoISP use the STK500v1 protocol. Larger chips (like the 1284p?) require the STK500v2 protocol.

1 Like

Could be, but as I can't program an arduino atmega328 using arduinoISP it's not the issue.

avrdude: verification error, first mismatch at byte 0x0000
0x3f != 0x00

You didn't disable auto-reset on the Arduino running ArduinoISP. The board was rest and avrdude was talking to the bootloader. It speaks a variant of STK500v1. It's happy to say "OK!" when you set the lock bits but always returns 0x00 when reading them back.

Connect a small (1 to 10 microfarad) capacitor between Reset (+) and Ground (-). This absorbs the reset pulse.

ok.With a 10uF capacitor between reset and gnd on the programmer. I get the following

That one reports failure due to this:

avrdude: Device signature = 0x1e9406

According to that, the chip you're programming onto is a 168 not a 328.

168 is in the arduino board being used as the programmer, 328 is in the target board.

Using Programmer : stk500v1

theres your problem stk500v1 != avrisp

how do you fix it? I dunno I usually get pissed and just do it myself from the command line, or if I dont need a bootloader Ill just add a entry to boards.txt

Ok.

I'm now really confused.

States 'Use the Burn Bootloader > Arduino as ISP command.'

This implies that either the instructions for arduinoISP are incorrect, OR the arduino IDE isn't doing the correct thing ?

OR the arduino IDE isn't doing the correct thing ?

that would be my guess

Ok.

Is anyone able to suggest a suitable alternative to using an arduino deicimila to program an 1284p ?

are you just trying to program it or bootload itso you can program it later using a serial connection?

Bootload to allow serial later.

For info I tried changing the programmer type using avrdude on the command line

Same result.

Argggg!

I share the feeling, I tend to cuss atleast once whenever messing with it

ok so how is the 328 clocked right now? like was it set for a external clock before and its now trying to run on an internal clock?

(also what os are you using, is that linux or mac?)

Arduino IDE 1.0 for macosx

16MHz crystal for the 328 (which is what it was previously)

I dont know how arduino acts on OSX (I have a mac but its 15 years old and only runs up to 10.2) so I dont know if you can just run avrdude from a command line without having to search for it ... in linux it installs a package that makes avrdude part of the path so you can execute it from anywhere but try running it from a command line, if it doesnt work you will have to hunt it down (which should be in the first couple lines of your pastebin)

anyway try running it from a terminal like

avrdude -p atmega328p -c avrisp -P /dev/tty.usbserial-A4001l0H -b 19200 -v

and make sure your reset is still disabled on the board

Ok.

Without the 10uF capacitor

30:avr swp$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cavrisp -P/dev/tty.usbserial-A4001l0H -b19200 

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/swp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A4001l0H
         Using Programmer              : avrisp
         Overriding Baud Rate          : 19200
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel AVR ISP
         Hardware Version: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.07s

avrdude: Device signature = 0x1e9406
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

with the 10uF capacitor in place

30:avr swp$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cavrisp -P/dev/tty.usbserial-A4001l0H -b19200 

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/swp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A4001l0H
         Using Programmer              : avrisp
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

Remove power to the 328 target

30:avr swp$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cavrisp -P/dev/tty.usbserial-A4001l0H -b19200 

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/swp/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A4001l0H
         Using Programmer              : avrisp
         Overriding Baud Rate          : 19200
avrdude: stk500_getsync(): not in sync: resp=0x66

avrdude done.  Thank you.

ok getting a little closer, load this on your arduino

http://code.google.com/p/mega-isp/downloads/detail?name=ArduinoISP.04.zip&can=2&q=

I remember someone saying that the isp on 1.0 is screwy, and I use this one all the time, then try avrdude again

I'm using the latest ArduinoISP as mentioned in the first post

arduinoisp.ino from GitHub - rsbohn/ArduinoISP: Use the Arduino to program AVR chips.

Osgeld:
ok getting a little closer, load this on your arduino

Google Code Archive - Long-term storage for Google Code Project Hosting.

I remember someone saying that the isp on 1.0 is screwy, and I use this one all the time, then try avrdude again

Ok, just given this a go with arduino022, 10uF capacitor. Still get the same result with the wrong chip being recognized.