TTL cable length for programmer

Using three different USB to TTL programming boards, I can upload using a 12" cable, or maybe even 2' cable, but 17' and 9' don't work. They all work fine for serial communication using the serial monitor at 9600 baud. Is there a length limit for serial com at 57,600 baud? All cables are braided.

The error messages are "programmer is not responding" and "not in sync: resp=0x1b"

In effect yes.

The slower you run the further you can get. This is because fast edges get get made slower by the capacitance of the cable. So if you go long you need to also go slow to ensure the signal gets through.

Also the type of cable matters. It is much better to have a straight cable like two strips of ribbon cable than to have a twisted pair, because a twisted pair has more mutual capacitance.

Thanks, Grumpy. But 20', even for twisted pair, doesn't seem like much for such a moderate frequency. I'd like to do a test. Is there a way to make the IDE use a slower speed? I'm guessing yes, but the limit is the fixed upload rate in the bootloader.

That is correct. Which Arduino board are you using? I ask because some of the 3rd party boards platforms come with a collection of bootloaders that are compiled for lower baud rates.

Pro-mini.

I did a quick test, changed the serial rate to 57,600 in my code and watched the text messages in my application for a couple minutes, maybe 200 messages, no errors. So the 17' cable is perfectly capable of handling multi-character text messages at that rate. Since the text messages are error free, I can only assume there is some timing critical DTR response that has nothing to do with the serial data quality in the cable.

Here's a copy of errors from one attempt to upload using the 17' cable:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x37
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x47
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x61
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x73
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x74
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x75
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x72
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x6e
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x65

Problem solved. Turns out it was the USB port on the laptop. The "bad" port works fine for serial messages, it just won't upload. What the heck?

I'm glad you found the solution. Thanks for taking the time to post an update with your findings.

Even though it is no longer needed, I'll follow up with the answer to your previous question just in case it is of use to someone with the same question reading this thread in the future:

The excellent 3rd party MiniCore boards platform includes bootloaders compiled for various upload baud rates for the ATmega328P (and ATmega168 as well) microcontroller of the Pro Mini. It is necessary to modify the platform's boards.txt configuration file in order to change which of the bootloaders and upload baud rates is used by Arduino IDE, as explained here:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.