Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I would like your advice relating to using the Arduino IDE and avrdude to program an ATmega328 which is preloaded with an Arduino bootloader. I am using a USB to TTL-serial breakout board based on an FTDI chip.

I bought a "FTDI Basic Program Downloader USB to TTL FT232 for Arduino ACC" off of ebay

FTDI USB to TTL F1232

I followed exactly this setup:

  1. Connect the DTR pin to pin 1 on the ATmega through the 0.1uF capacitor.

  2. Connect the RX pin to pin 3 on the ATmega (TX)

  3. Connect the TX pin to pin 2 on the ATmega (RX)

  4. Connect the 5V pin to the 5V rail of the board to supply the board with power from the USB interface.

  5. Connect the GND pin to the GND rail of the board

Setup (from instructions being followed)

When I try uploading a sketch, I get this bad boy :

avrdude: stk500_getsync(): not in sync: resp=0x00

Here's what I have tried so far:

Connecting the header pins of the arduino "shield" to the chip on the breadboard. In doing so I am using the Mega16U2 on board to send the program. Result : flawless! the program boots and everyone is happy

Back to the FTDI breakout board. Switch RX and TX (never know?) still nothing so switched back to initial TX - RX configuration.

The DTR pin out of the FTDI board is successfully resetting the ATmega328 for sure as it goes through it's magical blinking sequence when I try to upload something.

Now, I've tested to see if the ATmega328 can send serial info through the breakout board to by computer. It can.

I've noticed a few interesting things :

Both the TX and RX lines are always at 5v. I know this because If I connect a LED in parallel with the lines, they light up. But, the little tiny LEDs on the breakout board labeled TX and RX are not always on...why is that? Could that explain my problem?

If you'd like any more info, let me know, I'll get it for you.

---------------------------------------------EDIT------------------------------------------

Hello again,

OK I've added a 100uF electrolytic capacitor along with a 0.1uF one between 5v and GND. This isn't the suggested 47uF and 0.1uF but I guess it`ll help filter out none the less. ( while at it. What would it change?)

I've replaced my 1k pull-up resistor with a 10k one

I still am not able to upload a sketch and get the same error. DTR line calls a reset and I still get serial output. ( I have a sketch on it that sends incrementing integers through serial every second)

Also interestingly,( although I was still unable to send a sketch before this happened) any led I plug on pin 13 (aka 19) is now much dimmer...maybe that utlra bright white led I had earlier was pulling to much current with a 270 ohm resitor... -_- )

To popular demand here are pictures of my board and the USB to FTDI breakout board I am using. Breakoutboard

My breadboard

enter image description here

share|improve this question
    
TX and RX are generally pulled (or driven) high. I don't think your problem is there... –  bitsmack Apr 17 at 5:48
    
Any specific reason you went with serial programming instead of ISP? –  Ignacio Vazquez-Abrams Apr 17 at 5:54
1  
To expand on bitsmack's comment: The TX and RX lines will default to high, and briefly pulse low for data. Can be seen on a scope, but not on a meter. You can see it if you connect an LED+resistor from 5V to TX or RX (anode to 5V). The breakout board TX and RX lights are not directly wired to the actual TX/RX wires. –  gwideman Apr 17 at 7:34
    
Ignacio: I believe the ISP capability of this board is only a stopgap -- I think using bitbang. It's not a proper SPI I/O. Also, programming via the bootloader avoids accidentally programming things that ISP can program that are usually unintended. –  gwideman Apr 17 at 7:36
    
Anyway add a resistor for those led, they are not going to last long... –  Vladimir Cravero Apr 17 at 8:37
show 4 more comments

2 Answers

Couple of suggestions:

Looking at the picture you appear to be following here: http://perhof.files.wordpress.com/2011/11/arduino_breadboard_ftdi_basic.jpg, there is almost certainly an error which will cause Reset not to work as expected.

I think the Reset circuit is supposed to mimic the one in an actual Arduino, which has DTR connected via a 100nF (0.1uF) capacitor to /RESET (pin 1). The actual Arduino (eg: Deumilanove) schematic shows a 10k pullup resistor from pin 1 to +5V. This will force /RESET to become deasserted some brief time after being asserted by DTR going low.

However, on the breadboard in the photo, the 10k resistor is connected to the wrong end of the cap, attaching to DTR. This will have no effect, and means that the /RESET recovery will be only due to the in-built pullup, which is purportedly a higher value like 30 to 60k, and will thus take 3 to 6 times as long to reset, and will be more susceptible to noise.

Moving the 10k resistor pullup to pin 1 may solve the problem outright.

Another thing to check is whether to are actually getting 5V out of the 5V pin on the FTDI adapter. Many of those boards come with jumper headers or unsoldered jumper pads to allow you to wire the "Power out" pin to either 5V or the 3.3V regulator on the FTDI chip.

And add resistors (say 330 to 1k) in series with each of your LEDs to avoid the causing excessive load. The photo appears to show an LED wired directly across 5V-Gnd, and another from Vcc to D13. The first one by all rights should burn out immediately or cause some other havoc. However, it's possible these are LEDs with built-in series resistors.

It would also be good to add parallel 0.1uF and a 47uF capacitors across Gnd and VCC near the 328, to give it a clean supply.

share|improve this answer
    
The LEDs in the higher resolution version of that photo do seem to have resistors soldered to them under red heat-shrink tubing. –  RedGrittyBrick Apr 17 at 10:08
    
Ah, right, the first photo with the partially-completed breadboard shows that more distinctly. Thanks for pointing that out. Highly misleading for "young players" though! –  gwideman Apr 17 at 10:10
    
Thanks for the help. I did have resistances for the leds on my board. Ya, sorry for not posting my actual board, had no cameras on me at the time I posted. I didn't even notice the capacitor not being wired up inappropriately on the picture! That said, I initially had a look at the actual arduino schematic so I knew not to put the cap in series with the node connecting the pullup resistor and the cap-DTR, but , I used a 1k pull-up resistor, rather then a 10k. Could that be the problem? Ill test it out. and adding extra caps for GND and VCC. Thanks again. –  Ethienne Apr 17 at 17:44
    
Please post a sketch of what you actually did, because it's not clear from your verbal description that what you did is workable. –  gwideman Apr 17 at 23:19
    
Yup, will do the moment I get a bit of free time. if the corrections don't work that is –  Ethienne Apr 18 at 0:34
add comment

The only thing I can think of when I see this error, is that the wrong board is selected in the Arduino IDE. You probably need to select a board that uses the atmega328p.

share|improve this answer
    
I do have the UNO selected. –  Ethienne Apr 17 at 17:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.