[SOLVED] Unable to get bootloader into target with ATMEGA328P

My target is a bare bones ATMEGA328P 3.3V with 8Mhz ceramic resonator. I am trying to use a Sparkfun pro mini withATMEGA328P 3.3v/8Mhz to be the programmer.

When I follow directions as per http://sysexit.wordpress.com/2013/02/07/burning-a-bootloader-to-an-arduino-nano-using-another-arduino/ I am using the Arduino IDE 1.0.5 I download successfully the ArduinoISP sketch into the pro mini 3.3v 8Mhz. Now this is wired to my target which has a ATMEGA328P installed. It uses a ceramic resonator 8Mhz.Not a crystal. It takes 3.3v power from Vcc pin on the pro mini. All is powered via USB and the FTDI breakout no other supply connected.

The pro mini is fine and so is the FTDI breakout as I am able to run other sketches in it just fine.

Is there another better way to get the boot loader in my target?

This is the error message I get:

avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50 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=0x51

I have checked my connections and seems ok. I also tried swapping MSIO and MOSI.

Connections are:

Pro-mini Target ATMEGA CHIP pin JP-6 PIN MISO 10 16 MOSI 11 15 SCLK 9 17 RST 3 29 Vcc 4 4,6 GND 2 3,21

Any ideas how I can get a bootloader into my target?

PC is windows XP. I tried with another windows XP machine new load of IDE and FTDI driver same thing.

[SOLUTION] Turned out to be a connection problem, I was tying the resets on both boards together. When used the correct connection to reset pin on target all was good. (Also found later on a different board that I had other connections to SCK (went to buffer IC) seemed to load SCK so would not load boot loader. )

When you have the arduino IDE sketch running on your board, select the type of board you want to write the bootloader to in tools -> board. The board you select here determines which bootloader is burned into your target. E. g. when you want to have a standalone ATmega328 running on internal 8MHz take the "ATmega328 on a breadboard". You can also look in my blog at

http://heliosoph.mit-links.info/arduino-powered-by-capacitor-start/ There is a section about burning the bootloader to a standalone 328P. Also look at: http://www.gammon.com.au/forum/?id=11637

When you want to set your fuses for other configurations you also can look in my blog:

http://heliosoph.mit-links.info/arduinoisp-reading-writing-fuses-atmega328p/

Elektrix

Thanks for info but the option for "ATmega328 on a breadboard" does not appear in IDE 1.0.5

I think the problem is with AVRDUDE. If I try and run this stand alone It just puts up list of commands. It will not accept any of the options like -t or -F so if this is the case batch files will not work. This would be consistent with the error message avrdude: initialization failed, rc=-1

But I don't know how to fix this despite many hours of research.

Problem solved: First attempt fails as get initialization failure of avrdude.exe

code selects SS as slave reset pin:

include "pins_arduino.h"

define RESET SS

SS maps to pin 14 on 32pin TQFP ATMEGA328P part. (Arduino function digital pin 10)

On the SparkFun Arduino pro-mini this is on header pin JP6-12.

Looks like I did not use this but used the reset pin JP6-3. When instead I use SS as slave reset boot loader programs ok and tested blink sketch OK.

Hi, I have this problem too. I use Uno R3 as programmer and I want bootloader an Atmega 328p-au smd chip (tqfp 32 pins). Can you share your connections diagram please? Thanks in advance.

The datasheet for the '328P has the pinouts for the TQFP part. Summary datasheet http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Summary.pdf Complete datasheet http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet.pdf

You could also look at the schematics for a board like the ProMini on the Products page.

Connections Needed: Host Device +3.3 VCC, AVCC GND GND SCK SCK MISO MISO MOSI MOSI SS (D10) Reset along with resonator on the XTAL1, 2 pins. 10K resistor from Reset to Vcc. 0.1uF caps from VCC & AVCC to Gnd a good idea also.