RS232 cable required for upload of sketches, etc

I am trying to get RS232 connection from the PC to Arduino UNO rx/tx pins 1,2 with an intervening cable. This is to allow the PC to be operated remotely from the Arduino, ideally via a 10 metre screened cable.

I have a TTL/RS232 level converter at the Ardino end, having a female DB9 connector. At the PC I am using a USB serial adapter with a corresponding male DB9 connector. This works perfectly and uploads sketches on the bench. It has tell-tale LEDs indicating activity.

My assumption was that I would only require a 'straight' as opposed to cross-over cable with ground (pin 5), Rx (pin 3 at the PC end) and Tx (pin2 at the PC) - pins 3 and 2 respectively and TX and Rx at the Arduino end.

However this does not appear to be working at all, and I am seeing no signal at the PC end (via scope or LEDs), so I am now wondering if I need some strapping to persuade each end that there is a connection operating?

Does anyone know what strapping might be required (and if it is), and practically what baud rate can be achieved over 10 metres? How do I reduce the upload baud rate to keep it working? 115200 baud may be too ambitious.

waljoh:
My assumption was that I would only require a 'straight' as opposed to cross-over cable with ground (pin 5), Rx (pin 3 at the PC end) and Tx (pin2 at the PC) - pins 3 and 2 respectively and TX and Rx at the Arduino end.

I'm not clear how that differs from your working arrangement?

...R

Check if the information of the following diagram is of any help?

If it works to upload sketches , then nothing needs to be changed.

It only works when directly connected, e.g. serial usb adapter to max32 equivalent TTL level converter.

I am trying to get an intervening cable to work between the serial adapter and the level converter for the practical reason that the Arduino is boxed up, and within an exposed navigating/steering enclosure.

I have since tried strapping 4,6,8 at each end of the cable which resulted in some flashes of traffic, but nothing meaningful, i.e. received data was garbage, and upload does not sync with the Arduino.

Have you checked the end-to-end connectivity of each conductor with your multimeter?

Extending a cable should be straightforward.

...R

Why not just use a usb cable?

Allan

Robin2:
Have you checked the end-to-end connectivity of each conductor with your multimeter?

Extending a cable should be straightforward.

...R

No, haven't checked, but worth a whirl... and I expected it to be straightforward. My main concern was that over that distance the upload would not work at 11500 baud, but this doesn't manage 9600.

I am going to try another shorter cable..

allanhurst:
Why not just use a usb cable?

Seems like the most sensible suggestion so far.

…R

allanhurst:
Why not just use a usb cable?

Allan

It would I think be too long but in any case impossible to implement as the cable has to be routed through conduit. RS232 for greater immunity to noise etc. in screened cable.

Also, based on this assumption, and because of the need for a waterproof enclosure, the Arduino is inaccessible in its box.

waljoh:
It would I think be too long but in any case impossible to implement as the cable has to be routed through conduit. RS232 for greater immunity to noise etc. in screened cable.

Also, based on this assumption, and because of the need for a waterproof enclosure, the Arduino is inaccessible in its box.

In your Original Post you said "At the PC I am using a USB serial adapter with a corresponding male DB9 connector."

What's to stop you using a USB extension cable between the PC and the USB-Serial adapter? That has no impact on the cable going to the Arduino.

...R

Robin2:
Seems like the most sensible suggestion so far.

...R

USB over 10m isn't going to work well if at all surely?

Is your problem upload related? If so, your extension cable needs the dtr line as well for uploads; 2, 3 and 5 is not enough. You’ll need to lookup the pin.

MarkT:
USB over 10m isn't going to work well if at all surely?

Perhaps not. I missed the 10m bit

...R

sterretje:
Is your problem upload related? If so, your extension cable needs the dtr line as well for uploads; 2, 3 and 5 is not enough. You'll need to lookup the pin.

The longer cable was not delivering any sense (but was correctly wired).

I tried strapping 4,6,8 at each end - maybe incorrect but what I remember from making up serial printer cables in the 80's, although I think it was only the PC end that needed that.

I have now reduced to around 3m for testing purposes, and have a straight cable 2-2, 3-3, 4-4(DTR), 5-5. I understand DTR is used on some boards to initiate a reset using the edge of the pulse, but this requires support in the level converter and wiring to the reset pin? I don't have that, just using rx and tx, which work locally without the intervening cable.

Data is received at the monitor OK (9600 baud), but uploads fail. I am using a manual reset while attempting the upload. :

Overriding Baud Rate : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xbf
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xfc
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.

Interestingly, the responses vary, but I don't know where to find their significance.

Probably 115200 baud is asking too much, but I don't know if it is possible to slow the upload down

Just to close it off, the shorter (3m) straight cable worked. It included DTR but there is no support for this (e.g wiring a capacitor to the reset pin).

I found that switching off the Arduino, starting the upload, then powering up immediately seemed to give the best results - not much joy from my reset switch while powered up. It sometimes took several attempts, but once started seemed to run to completion.

I don't know how, but I think slowing the baud rate for the upload might help to make it more reliable.

As you (probably know), baudrates must match at both side. That means modifying the boot loader code and loading a new boot loader into the target Arduino. Next you can modify one of the configuration files (I think it's boards.txt).

Not sure if you will gain much.