Protocol error during upload

Hello,

Fairly new to Arduino and could use some help. Attempting to upload a sketch (the blink example) to an ATmega328 with Arduino Optiboot (Uno) purchased from Sparkfun on a breadboard.

I am selecting Arduino Uno as board type on tools menu (as this seems to be the only type that works at all), and resetting the board just prior to upload. I am doing the following procedure and am using the FTDI Basic 5v from Sparkfun.

1 Hold reset

2 Unplug USB from computer

3 Release reset

4 Plug USB into computer

5 LED connected to PIN 13 does a series of rapid blinks (it appears to be 6 sets of 3 blinks).

6 Press upload button.

I have also experimented with switching step 3 and 4, as well as pressing upload and waiting until compiling is complete before releasing reset.

During upload I get the following error.

         Using Port                    : \\.\COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         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
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
avrdude: Send: A [41] . [80]   [20] 
Back and forth communication removed due to character limit!
avrdude: Recv: . [10] 
         Hardware Version: 3
         Firmware Version: 4.4
avrdude: Send: A [41] . [84]   [20] 
Back and forth communication removed due to character limit!
avrdude: Recv: . [10] 
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: Send: A [41] . [81]   [20] 
Back and forth communication removed due to character limit!
avrdude: Recv: . [10] 
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75]   [20] 
avrdude: Recv: . [14] . [1e] . [95] . [0f] . [10] 
################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: Send: V [56] . [a0] . [03] . [fc] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] . [a0] . [03] . [fd] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] . [a0] . [03] . [fe] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] . [a0] . [03] . [ff] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: reading input file "C:\Users\JPATT_~1\AppData\Local\Temp\build1755849196468699029.tmp\Blink.cpp.hex"
avrdude: writing flash (1082 bytes):

Writing | avrdude: Send: U [55] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: d [64] The sketch is here removed due to character limit! [20] 
avrdude: Recv: . [00] 

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c]   [20] 
avrdude: Recv: 
avrdude: stk500_cmd(): programmer is out of sync

As I stated I am fairly new, but it appears to me that communication is fine until the upload of the actual sketch begins and then there is a failure. I have searched the forums and internet for "protocol error, expect=0x14, resp=0x00" but all result I have located have been failures related to initial communication with the Arduino (not properly wired, not properly powered, reset not done, etc). I am able to upload the same sketch to a Pro Mini 328 board using the same FTDI Basic, additionally I am able to do a loopback test with the FTDI basic and loopback functions fine.

I can post a schematic if necessary; however, it is minimal.

PIN 1 to 10K Resistor to +5V/Reset jumper to GND/.1UF Cap to DTR on FTDI Basic header.
PIN 2 to TXO on FTDI header
PIN 3 to RXI on FTDI header
PIN 7 +5V
PIN 8 GND
PIN 9 to PIN 1 on 16Mhz resonator
PIN 10 to PIN 3 on 16Mhz resonator (PIN 2 of resonator to GND)
PIN 19 to resistor to LED
PIN 20 to +5v
PIN 21 to .1UF Cap to GND
PIN 22 to GND
.1uf CAP between +5 and GND near pins 7 and 8 on the Arduino (it does not change anything if this is here or not, have tried both ways)

I am currently using +5V and GRD on FTDI connected to + and - on breadboard to power the Arduino, but have used a LM7805 circuit supplied by a 11.7V LiPo with FTDI GND connected to - on breadboard with same results.

I have rebuilt the circuit several times to insure no wiring errors and have drawn a schematic based off of how the board is actually wired to compare to how the board should be wired and see no issues. I do not know where to go from here, as I am not familiar enough with the material to make an educated guess at a possible solution. As I stated I do have a Pro Mini 328 that I can use if I need to re-burn the bootloader (which is one solution I have not attempted) if required, otherwise any assistance or advice would be greatly appreciated.

Connect RTS on the FTDI, via a 01.uF to pin 1. (It works with my CH340 chip, and my bare bones I have just built).

I did initially have an issue uploading but that was because I connected TX to pin 1 in error. Uploaded the blink sketch and away it went.

I did burn the optiboot on my own sourced chips though.

ChilliTronix:
Connect RTS on the FTDI, via a 01.uF to pin 1. (It works with my CH340 chip, and my bare bones I have just built).

I did initially have an issue uploading but that was because I connected TX to pin 1 in error. Uploaded the blink sketch and away it went.

I did burn the optiboot on my own sourced chips though.

I have "DTR" from FTDI connected to PIN 1 through a .1 ufd Cap, and a 10K resistor from PIN 1 to +5v.

What are you using as the programmer in the Arduino IDE?

ChilliTronix:
What are you using as the programmer in the Arduino IDE?

ArduinoISP is selected, and I am using the upload button (Not "Upload Using Programmer"). I can upload a sketch to my Pro Mini, switch serial hookup to UNO, select UNO from Board, and hit upload resulting in what you see above, which appears to be a partial upload.

Note that the LED should be on pin 19 (Arduino Pin 13), not pin 13 (Arduino Pin 7).

See this diagram which shows the pin numbers but does not include the LED on D13:
http://www.mindkits.co.nz/images/Tutorials/example10p1schematicsmall.jpg

Thank you, good catch! The LED is to Arduino 13/Physical pin 19, simply failed to convert when making original post. Corrected above.

Does that means it works now?

ChilliTronix:
Does that means it works now?

No, still not working. Looking more closely at the output it appears that everything is fine during reads from the Arduino, and it all goes south during the first write. I do not have another stand alone chip on hand so I am unable to test whether it is something defective with this chip in particular.

I will note that during experimentation I have noticed that the error occurs regardless of whether the 16Mhz resonator is hooked up or not (and same failure with a different resonator installed).

I have attempted to reburn bootloader using my Pro Mini as ISP with no success either. Tomorrow I should be receiving an AVR programmer and will attempt to erase the chip and burn a fresh copy of bootloader.

SOLVED:

Got another Atmega328p as well as a USBasp, second Atmega functions as expected in same circuit, original still does not function (fails verification during uploads). Further experimentation with USBasp, AVRDude, and using Pro Mini as ISP it would appear that it is simply a case of a bad chip. Thanks for the assistance.

Good news sort of...