Arduino Ethernet won't program with FTDI cable

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

I'm tearing my hair out trying to get my new Arduino Ethernet programmed with an FTDI cable. Well, what hair I have left. ;)

I have a number of programming cables at my disposal. I've got a USBtinyISP, a Mini USB/Serial adapter (with FTDI232 chip) and a Parallax PropPlug (also an FTDI232 chip). With the USBtinyISP, I am able to burn a new bootloader (I loaded Optiboot 4.4 using avrdude in a command line). I can also use the usbtiny to upload a sketch directly to the Arduino using the "Upload using Programmer" function in the Arduino IDE. I've loaded the standard blink program and confirmed that it works.

The trouble is with the two FTDI cables. I'm fine with programming with the usbtiny, but I really need to talk to the arduino over the serial connection to see what's going on. But, neither seems to be able to communicate with the arduino. I confirmed both are working by jumpering the TX and RX lines to see the echo. But I can't upload with them, or view serial messages coming from the arduino. All I get is the standard (and dreaded) response when uploading:

Code: Select all

         Using Port                    : \\.\COM2
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: 
avrdude: stk500_getsync(): not in sync: resp=0x00
So what's going on here? This is the same message I get if the FTDI cable isn't connected at all. I've read some vague messages about "using programmer" needing to be set to "arduino" which it seems to be. So why does it say stk500_getsync later on? Maybe there's something in the bootloader code that needs to be enabled to allow serial comms on pin 0 and 1? Is the baud rate too fast, maybe?

Please help!

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

I did another experiment, where I created a sketch that caused pins 0 and 1 to turn on and off. I uploaded it with "Upload using programmer", and the pins do turn on and off as expected. So, there doesn't seem to be anything wrong with the serial pins themselves.

That leaves some sort of timing error between the FTDI cable, or something wrong with the bootloader. Unless, there are other experiments I should try?

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

I probed the FTDI cable with my scope, and noticed something interesting. The TX line will send a small bit of data (8 bits, maybe? 16?) but that's it. There is never a response on the RX line. Is it correct to assume that the upload process begins with the programmer initiating contact, and when a response is received it begins to upload data? If so that would explain why I can't upload sketches via the ftdi cable.

But why is this happening? Hmmm. Time for more experiments.

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

OK! I uploaded another sketch to test whether the TX and RX pins can act as inputs. Long story short; they can.

The sketch simply reads the pins and if they go high, the LED turns on. Works with both 5V and 3.3V. So, my problem has nothing to do with physical damage to the serial pins.

User avatar
westfw
 
Posts: 2008
Joined: Fri Apr 27, 2007 1:01 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by westfw »

Not all FTDI/Serial adapters will have the right signals to work with the Arduino auto-reset capability (and of course your PropPlug has an entirely different pinout that is very subject to mis-connecting.) Confirm that the Rx/Tx wiring is correct (the terms are ambiguous. "Tx" on any given adapter could mean "I transmit on this pin", or it could mean "connect me to the pin that the other party transmits on"), and perhaps try manual reset (which is a pain, since the default bootloader only has a one-second window where it wants to see

The reset issue shouldn't have any effect on serial communications with a sketch that was loaded using the USBTiny, though. Since you have the programmer, I would suggest loading up some sort of serial test program and debugging the serial communications SEPARATELY from debugging the (possible) auto-reset issue...

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

Yep, I was careful matching the tx and rc lines, though I swapped them anyway just in case. ;)

I've got the latest version USB/serial adapter, so I was able to run an extra wire from the adapter's RTS pin to the reset pin on the arduino. Not sure if it worked though... I should verify that.

That's a very good idea though. I'll load up a sketch that continually sends serial data, and see if I can read it back.

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

OK! I loaded in the "SerialCalResponse" sketch and it seems to work fine. It scrolls "A" until I send it some data, then it spits back a bit of garbage (since I don't have a sensor hooked up). So that means serial communication IS possible, at least at 9600 baud.

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

Well, at this point I've got the USBtinyISP and my FTDI cable working together. I use the ISP to program the arduino, and can talk to it just fine afterwards with the FTDI. It's not ideal, but it works. If anyone else is having similar issues, this might be a temporary fix until something (not sure what...) gets resolved.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Arduino Ethernet won't program with FTDI cable

Post by pburgess »

Have you tried restoring the stock bootloader?

User avatar
jeff-o
 
Posts: 8
Joined: Fri Feb 10, 2012 11:17 pm

Re: Arduino Ethernet won't program with FTDI cable

Post by jeff-o »

Several times. The original bootloader and optiboot 4.4 seem to behave the same way. Perhaps by now they ARE the same (in the latest Arduino install). Unfortunately, I can't check the bootloader version using avrdude because that requires a serial programmer!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”