Using Arduino as ISP to burn Blink to atmega328pu chip - Help!

OK....I am going to ask for help!

I am and I am not a newbie....new to microcontroller programming though...I got to be overlooking something very basic...always is basic...once you know what it is!

After two weeks of daily frustrations....all I want to do is burn the Blink sketch to an ATMEGA328 PU and then have it run on a standalone breadboard. I have followed the instructions to a TEE as below. They mirror numerous other postings.

All goes well up to loading the Blink sketch....I get the following error following compilation....

I am using Arduino IDE 1.8.6.
RPI 3 running LInux Jessie.

have searched extensively to try to run down these errors....makes no sense that the Serial Port is not found....since the ArduinoISP sketch downloads to two different UNOs on the serial port /dev/ttACM0 successfully....just get the error when using Arduino as ISP Programmer....
The full verbose error message is attached.

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: 569736
Firmware Version: 106140.397896
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done. Thank you.

the selected serial port
does not exist or your board is not connected

Blink error.txt (8.62 KB)

(deleted)

thank you for your response! I appreciate cheeky! Yes...please make me work for it. Today I spent the morning trying to decipher avrdude error messages and reviewing my rpi port permissions, trying to set it in arduinoisp, trying to figure out how libraries may play into it....

I am 70 years old...recently retired and have decided that over the next 5 years I am going to master microcontroller programming after an IT career on the infrastructure side....

Attached is the breadboard. The LED lit is the heartbeart. the Green led on the left is pin 13.

it seems the uno recognizes the serial port...however once it goes as Arduino as ISP that seems to drop. The processor light flashes briefly during the failed attempt.

using atmega328 pu from multiple sources...two provided with bootloader loaded and one set blank where I attempted to load the bootloader.

(deleted)

Also, we need to see different views, get rid of that bright LED.

You need a decoupling capacitor (.1 μF ) next to the chip, 5v to GND.

Read Mr. Gammon’s discussion here:
https://www.gammon.com.au/breadboard

thank you for your response! I appreciate cheeky! Yes...please make me work for it. Today I spent the morning trying to decipher avrdude error messages and reviewing my rpi port permissions, trying to set it in arduinoisp, trying to figure out how libraries may play into it....

I am 70 years old...recently retired and have decided that over the next 5 years I am going to master microcontroller programming after an IT career on the infrastructure side....

Attached is the breadboard. The LED lit is the heartbeart. the Green led on the left is pin 13.

it seems the uno recognizes the serial port...however once it goes as Arduino as ISP that seems to drop. The processor light flashes briefly during the failed attempt.

using atmega328 pu from multiple sources...two provided with bootloader loaded and one set blank where I attempted to load the bootloader.

  • replaced components as specified in your responses..
  • removed distracting led connections from uno to breadboard
  • attached clearer images.

Thank you for the gammon link....and your time and patience.

(deleted)

As mentioned, use 22pF.

Neatness counts with breadboard circuits:

bootload burn ERROR attached.

replaced the 221 with 22...(misread how to read capacitor coding...sigh...lesson learned)

BOOTLOADER ERROR.txt (3.42 KB)

Change both 221 to 220 or just 22

Changed both 221 to 22

Not sure why you are using a zif socket and it is not obvious from the images that the pins are correctly wired.
Try plugging the controller into the breadboard directly.

I follow the Nick Gammon write-up for ICSP programming, never had a problem.

FYI
Bootloader discussion here:
https://www.gammon.com.au/forum/?id=11635

Basic issue seems to keep coming back to....

the selected serial port
does not exist or your board is not connected

I will work through the gammon site....

Do you have any inisghts into the error message?

the selected serial port
does not exist or your board is not connected

The Gammon instructions are well documented and were successful up to burning the bootloader.....but still not resolving the issue.....I cannot upload Blink using Arduino as ISP.

Read these:
https://www.gammon.com.au/forum/?id=11643

https://www.gammon.com.au/forum/?id=11633

What is written on the breadboard controller chip?

Did you upload the ISP sketch to the original Arduino board?
Did you then load the blink sketch in the IDE editor?
Then did you select the proper target for the breadboard controller?
Then did you use the upload using the Arduino ISP programmer?

Do you have any inisghts into the error message?

kprims@mint ~ $ /home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude -C/home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b19200 -Uflash:w:/tmp/arduino_build_671156/Blink1.ino.hex:i

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/etc/avrdude.conf"
User configuration file is "/home/kprims/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyUSB0
Using Programmer : arduino
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 : Arduino
Description : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: 4238814
Firmware Version: 20649456.0
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

***********Notice the -carduino in the avrdude command.

Now I change it to -cstk500v1.

kprims@mint ~ $ /home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude -C/home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:/tmp/arduino_build_671156/Blink1.ino.hex:i

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/etc/avrdude.conf"
User configuration file is "/home/kprims/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyUSB0
Using Programmer : stk500v1
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 STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
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.02s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/tmp/arduino_build_671156/Blink1.ino.hex"
avrdude: writing flash (1080 bytes):

Writing | ################################################## | 100% 1.26s

avrdude: 1080 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_671156/Blink1.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_671156/Blink1.ino.hex:
avrdude: input file /tmp/arduino_build_671156/Blink1.ino.hex contains 1080 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.70s

avrdude: verifying ...
avrdude: 1080 bytes of flash verified

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

avrdude done. Thank you.

Try changing your command in a terminal something like this. -cstk500v1

/opt/arduino_1_8/arduino-nightly/hardware/tools/avr/bin/avrdude -C/opt/arduino_1_8/arduino-nightly/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyACM0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

This is just the first command to set your fuse, but it should give you some different information.

I don't know why your commands are selecting -carduino, because when I burn bootloader or upload using "sketch/Upload Using Programmer" I always get -cstk500v1.

If I select just the upload button, then I get -carduino.

Running:
Linux Mint 18.3
Arduino IDE1.8.5
Boards 1.6.207

OK....to maintain sanity...I read and am following the below instruction set. I was able to proceed according to script all the way to the point of loading the ASCII sketch.
´Mr. Gammon's discussion here:
https://www.gammon.com.au/breadboard ´
Below are the results of the Board Detector and Board Programming (selected U) sketches as well as the error I get when trying to upload the ASCII sketch.

Board matches the picture...using the Sparkfun FTDI cable.

I am left with what seems to be a basic issue with avrdude....I can´t come up with a lead on how to decipher or trace this error.

Would appreciate the śilver bullet´ or some ´bread crumbs´ to follow.

Thanks for your support!

Board Detector.txt (6.03 KB)

board programmer monday.txt (1.82 KB)

error monday.txt (7.29 KB)

Gammon was using the 8MHz Lilypad without a crystal. Are you using the crystal (16MHz) plus the 22pf capacitors?