RS232 interface to Arduino Uno...plug and play??

Hi,
I need an RS232 interface to the Arduino Uno but it seems that this does not exist out there. Well it does, but it doesn't. What I mean by this is that there are RS232 shields, and there are RS232 Level shifters but none of them seem to work natively without software needing to be uploaded to the arduino.

What I need is a true RS232 connection (wire will need to be 50+ feet long) that I plug into the arduino board and then can use the IDE to upload software over this connection. Therefore it must use the native TX and RX connections not different pins repurposed for RS232 communications.

Does anyone have an idea on how this could be done?
I tried the DFRobot RS232 to TTL but have no luck. I keep getting the avrdude: stk500_getsync() error.

Thanks for any insight.

I tried the DFRobot RS232 to TTL but have no luck. I keep getting the avrdude: stk500_getsync() error.

Post a link to your device and your code.

Use a RS232 to TTL converter that includes the DTR line and connect it to the reset pin.

Use a short cable just to get it working reliably then try the long cable.

Hi The link to the device is

and the code is a simple loopback.

char readbyte;

void setup()
{
Serial.begin(9600);
}

void loop()
{

while (Serial.available() > 0 ) {
readbyte = Serial.read();
Serial.print(readbyte);
}
}

The program never finishes uploading so obviously it is not working properly.

tomb18:
then can use the IDE to upload software over this connection.

I have used an FTDI (USB-TTL serial) cable to upload code to a breadboard Atmega 328 which has the Arduino bootloader installed. I think the connections are just as @mikb55 suggested.

I presume the same will work with an Arduino board.

...R

tomb18:
The program never finishes uploading so obviously it is not working properly.

do you have anything connected to pins 0 and 1 while you are trying to upload new code? Pins 0,1 are the HardwareSerial on a UNO, they are used by the uploader to communicate with the AVR. If you have anything else attached to these pins, the upload will fail.

Chuck.

mikb55:
Use a RS232 to TTL converter that includes the DTR line and connect it to the reset pin.

Use a short cable just to get it working reliably then try the long cable.

Ok, but I purchased the device and i could take a wire off the DTR line.
However, how will this help? There is no operating system based handshaking here so would the DTR signal get asserted anyways? Or does it just need to be hard wired on?

chucktodd:
do you have anything connected to pins 0 and 1 while you are trying to upload new code? Pins 0,1 are the HardwareSerial on a UNO, they are used by the uploader to communicate with the AVR. If you have anything else attached to these pins, the upload will fail.

Chuck.

Well yes, I have the RS232 to TTL device connected to those pins! That's the whole point! I want to use the native COM port. The Arduino will be 50 feet from a computer so I need to use the RS232 connection to load programs etc. Exactly the same as if it was plugged into a USB port.
If I need to use a different pin set and different software then I will need to plug in a regular USB cable everytime I make changes to the program no? Unless I modify the boot loader?

Tom

Hi based on this it would seem that at least from the hardware perspective this is possible:

Is this what is suggested?
Thanks

An Arduino with the default bootloader will only allow reprogramming immediately after a reset.
The Arduino IDE uses the DTR line as the trigger to perform a reset, not for handshaking.

As you have found, many of the commonly available RS232 to TTL converters only connect a subset of the handshake lines to the connector even though the converter chip usually has pins for all of them. If you have a microscope and a steady hand you may be able to solder a wire to the unused DTR line on the chip.

This true RS232 - TTL converter features a DTR line, and seven other control signals (that can be ignored).

"Cable length is one of the most discussed items in RS232 world. The standard has a clear answer, the maximum cable length is 50 feet, or the cable length equal to a capacitance of 2500 pF. The latter rule is often forgotten."

mikb55:
An Arduino with the default bootloader will only allow reprogramming immediately after a reset.
The Arduino IDE uses the DTR line as the trigger to perform a reset, not for handshaking.

As you have found, many of the commonly available RS232 to TTL converters only connect a subset of the handshake lines to the connector even though the converter chip usually has pins for all of them. If you have a microscope and a steady hand you may be able to solder a wire to the unused DTR line on the chip.

Hi,
Are you saying that when I use the IDE to send a program to the Arduino, the IDE is providing the DTR signal to put the Arduino in programming mode?
If this is the case, then why can I not use the devices I have for the communications through the serial port? In other words, I use the USB port and move the serial port loopback code, and then connect my device. Should it not work properly then? It seems it doesn’t.
I have tried the device above and my own MAX232 chip circuit. Both do not work…I think…maybe I tried in both cases, only uploading code which would not work due to the lack of DTR signals…

I’ll look at this all again and get back here.
Thanks

tomb18:
why can I not use the devices I have for the communications through the serial port? In other words, I use the USB port and move the serial port loopback code, and then connect my device. Should it not work properly then?

I don't understand any of that.

What devices do you already have?
Does your PC have a real Serial Port? - most new ones don't.
What do you mean by "I use the USB port"
What do you mean by " and move the serial port loopback code"
and how does that relate to ", and then connect my device"

Maybe you can make a diagram to show what you have in mind ?

...R

Robin2:
I don't understand any of that.

What devices do you already have?
Does your PC have a real Serial Port? - most new ones don't.
What do you mean by "I use the USB port"
What do you mean by " and move the serial port loopback code"
and how does that relate to ", and then connect my device"

Maybe you can make a diagram to show what you have in mind ?

...R

Hi, it's all above.
I need to use a serial port since the cable length I want is around 50 feet. Therefore I paln to use a USB to serial adapter, an RS232 cable, and then connect this to the RS232 to TTL level device I mentioned.

Ok, progress!!!!

So I am using the DFRobot RS232 to TTL adapter mentioned above. What threw me off was that when I hooked it up, the first thing I tried to do was send a program to the arduino. As I learned here, the IDE actually will do something to the DTR signal which will allow the Arduino to accept a program.
So, if I upload the loopback code through the usual USB connection and then wire up the RS232 / TTL board and then try the new serial port it works!
All I need to do now is hook up the DTR line to the DTR line on the MAX202 on the RS232 to TTL device.
No need for a microscope....

Much obliged!!
Added the DTR wire soldered to the DTR pin of the 9 pin serial connector and then connected this to reset on the Arduino Uno and lo and behold, it now programs and works!!
Complete with 50 foot cable.
Many thanks to all that helped out here.
Tom

Ok, now this is embarrassing. The anbove works fine with the DFRobot rs232 to ttl board and the DTR signal directly connected from serial port to the reset pin on the arduino.
Now I want to do the same thing but using components. I am using a max232 chip and followed this guide:

I can connect perfectly fine and my loop back code from above works. So far so good. However I cannot program the arduino now. I have tried as shown in the above link, and it will not program. It just hangs at the end of transfer. I connected this instead using DTR, exactly as in the DFRobot version. It still does not work.
This I cannot understand. I took the DFRObot version, wrote out the exact schematic (and traced all connections) and did exactly the same thing with my discrete components and it still doesn't work. I'm stumped. I checked and rechecked the circuit, used different wires to no avail. Any suggestions?

Hi,
Yes it can take a script using the USB.
I haven’t been able to get the “hit the reset” button to work either.

But as I mentioned, the loopback works and if I load a program into the arduino I can then monitor it with the serial connection just fine. It’s just the programming. BUT it works with the DFRobot board! Which is identical to my circuit!

The DFRobot RS232-to-TTL Converter only converts TXD and RXD. It does not connect DTR to anything. How are you getting a TTL version of the DTR signal to the reset pin of your Arduino through a 100 nF capacitor?