[SOLVED] Another not in sync thread.. but serial comms working, chip ok

Hi,

Its very disheartening to have to post here for help as I really wanted to solve this problem on my own but to no avail.

I purchased some 328's from http://cgi.ebay.co.uk/Atmel-ATMEGA-328P-PU-UNO-bootloader-XTAL-22pf-caps-/320702036687?_trksid=p5197.m7&_trkparms=algo%3DLVI%26itu%3DUCI%26otn%3D5%26po%3DLVI%26ps%3D63%26clkid%3D271121225359777888 and a SparkFun FT232R breakout board (removing the solder jumper so as to go from 3.3v to 5v, also checked voltage with my meter). I followed the instructions at http://www.arduino.cc/en/Main/Standalone (I think there is a problem there because at one point it says to take VCCIO to the +5v rail but the photo differs, I went from VCC instead which I believe is correct)

When I powered my 328 for the first time both the TX and RX leds on the breakout board flash simultaneously three times, the power led on my breadboard is on and the led on p13 goes into a loop of three led blinks but when I try to upload a sketch things are not working.

I hit upload in the IDE and as soon as compilation is complete I hit the reset button on the breadboard (have also tried different combinations/timings of this), the TX led on the breakout board flashes three times, then a long pause, then a single flash of the TX led, another pause then the IDE responds:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I tried two different 328's with the same result. They came preloaded with the uno bootloader but to be sure and validate the chip I took one of them and placed it into my UNO, uploaded a sketch to it no problem so the 328 itself is fine. I put that same 328 back into the breadboard and opened the serial console, I get my serial output back as one would expect. Try to upload a new sketch on the breadboard and again I get not in sync.

I've tried on two different 64bit win 7 machines (of which both work fine with my uno) I've also tried on debian squeeze. Tried different cables, different board selections in the IDE, Obviously I've checked the com port stuff and as mentioned I've got serial output coming back. I've rebuilt the circuit on the breadboard several times now, I've double checked my resistor values (as I have in the past put the wrong value resistors in place, doh!) I've tried changes to the baud rates in the boards.txt file and set the baud on the com port to match (assuming 8 bits, no parity no flow control is correct?), I've read many posts and now I am totally lost.

Is anyone able to help?

Thanks in advance.

It could be as simple as your not timing the reset switch on the breadboard at the correct time. The method that seems to work the best is to press and hold the reset switch down, then press upload on the arduino IDE. When the IDE output windows first displays the memory size of the compiled sketch, that is the time to let go of the reset switch.

Other problems people have uploading to a breadboard standalone 328 is proper crystal and padding capacitor size. Many get the wrong size crystal caps. A 3 pin 16Mhz resonator device is simpler to wire up as it's caps are internal.

Good luck

Lefty

retrolefty:
It could be as simple as your not timing the reset switch on the breadboard at the correct time. The method that seems to work the best is to press and hold the reset switch down, then press upload on the arduino IDE. When the IDE output windows first displays the memory size of the compiled sketch, that is the time to let go of the reset switch.

Thanks for the advice but I've already tried that method several times with no joy

retrolefty:
Other problems people have uploading to a breadboard standalone 328 is proper crystal and padding capacitor size. Many get the wrong size crystal caps. A 3 pin 16Mhz resonator device is simpler to wire up as it's caps are internal.

The caps (22pf) and crystal (16Mhz) came with the 328, as I ordered two I tried the other crystal and caps too.

Im at a real loss, this should work fine. I will have to try a resonator I guess

Edit: After reading more stuff, if this was a problem with the crystal and/or caps my timing would be out right? Uploading the blink example to the 328 in my uno board and dropping it back in the breadboard gives me 30 blinks on p13 in 60 seconds which is about right.. no?

Upgraded to v22 on debian. Now have

avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout

Nobody has any other ideas?

:frowning:

Well the problem is now solved. Turns out that the standalone instructions are a little misleading, perhaps not to someone with experience but for a complete noob like myself.

In my original post I happened to mention that I thought the instructions were wrong...

outofsight:
I followed the instructions at http://www.arduino.cc/en/Main/Standalone (I think there is a problem there because at one point it says to take VCCIO to the +5v rail but the photo differs, I went from VCC instead which I believe is correct)

I mistook the purpose of the 3.3v solder jumper on the FT232R, I had taken this to mean that with the jumper in place, VCC was outputting 3.3v and by removing it, VCC would put out 5v but thats just plain wrong, it obviously has something to do with telling the FT232R that you want 5v TX/RX lines.

The instructions are indeed correct, you do need to connect VCCIO to +5v in this scenario as well as VCC. However in the instructions, the photograph immediately above the text "And there you have it... ready to be plugged in, powered up and programmed!" does not show this link.

I must confess to feeling rather stupid now as I wasted a lot of time reading posts that were totally unrelated to my issue, confusing myself and in the process pulling much grey hair out. Hopefully if someone else makes the same mistake, they'll come across this thread and save themsevels a little hassle.