Trouble uploading to a ATMEGA328 Chip from Arduino UNO SMD Edition

Hi,

I'm having problems using an Arduino UNO SMD to upload a sketch to an ATMEGA328 chip (not the ATMEGA328P). So far, I've managed to successfully install the bootloader on the chip, but I'm having trouble uploading a sketch to it.

The setup i'm using looks like this, and is taken from the http://arduino.cc/en/Tutorial/ArduinoToBreadboard tutorial

and the error message I get is this - avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0xf1 avrdude: stk500_recv(): programmer is not responding

Since I had to modify the avrdude.conf file to install the bootloader, I tried modifying that again so the signature is what would be expected for a ATMEGA328 Non-P chip (signature = 0x1e 0x95 0x14), but it didn't like that and i got this message - avrdude: Expected signature for ATMEGA328P is 1E 95 14 Double check chip, or use -F to override this check.

According to the tutorial, I should remove the chip from the Arduino when using it to program another chip. Unfortunately, with the SMD Uno, I can't remove the chip, so I guess that could be causing the issues? Is there a workaround for that? Or does someone think I may be having a different problem?

Thanks, Dave

When you try to upload the sketch, the on-board mcu and the one you are programming will fight for control of the Tx line, so the data received back through the USB port will be garbage. That could be causing the problem.

One solution would be to locate the 1K SMD resistor that is connected between the Tx pin and the USB-to-serial converter mcu (it's 1K on the normal Uno, I assume it is the same for the SMD version). Then connect pin 3 of the target mcu to the other side of that resistor instead of to the Tx pin, so that the target mcu drives the serial-to-USB chip directly. The on-board mcu will be driving it through the 1K resistor still, so it will lose the battle.

Personally, I never bother burning a bootloader on chips I am using for projects, I program the chips using ICSP instead (you can use your Arduino as an ICSP).

Thanks DC. I think I'm still too much of a beginner to go for your first suggestion, so I guess I'll get myself a cable so I can program the chips directly.

My cheap budget DIY arduino is quickly becoming an expensive DIY arduino :-)

The other alternative is to use a separate serial cable to communicate with the 328 instead of using the UNO SMD.

That's all you're using it as anyway, a USB->TTL serial adaptor. Pick one up for next to nothing off eBay and forget the UNO SMD.

Yep, I think i'm going to go with that option majenko. I'm just beginning Arduino, so anything to make it simpler :-)

Thanks

I have a UNO SMD as well, and I found a trick for this. Write a sketch to the UNO SMD which sets pin 0 and 1 to inputs, and disable the autoreset.(10uf cap between reset and ground). Then you kan use your arduino to program the other chip without removing the onboard chip.

This will work, but it is much faster just using a USB->TTL serial adapter. I use this http://www.ebay.com/itm/USB-2-0-to-UART-TTL-6PIN-Connector-Module-Serial-Converter-CP2102-New-/190685792376?pt=LH_DefaultDomain_0&hash=item2c65c24878. with a small mod the autoreset function will also work.

Alternatively, don't use a bootloader to upload the sketch, upload the sketch directly in the same way that you uploaded the bootloader.

It is easy to make a small board - shield - that you can plug into your Arduino that has a 28 pin socket for you 328P, a resonator and a couple capacitors, power and ground and a 120 Ohm resistor from Arduino REset to +5V and that connects the necesary wires to program the chip using ArduinoISP. Then you have it for programming the next chip you buy. Then test teh sketch with your Arduino board, and then load ArduionISP, insert your "ISP Shield" and program the chip using the Arduiuno as ISP option.