TTL UART 3.3v cable length?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
doanerock
 
Posts: 28
Joined: Wed Oct 01, 2014 10:49 am

TTL UART 3.3v cable length?

Post by doanerock »

I have ben having trouble finding an answer to my question after much search. The question is what is the max distance that TTL UART 3.3v cable length can be? How much does it vary at diffrent baud rates. I know TTL UART 3.3v is not designed to travel too far but is there documentation somewhere as to what the fartest that a TTL UART 3.3v signal can be transmitted. I remember hearing 12 inch wire once, is that correct?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TTL UART 3.3v cable length?

Post by adafruit_support_mike »

It depends on a lot of factors: baudrate, the nature of the wiring, the exact circuit driving the cable, and so on.

In general though, UART connections are pretty robust. I'd expect a microcontroller's GPIO pins to be able to drive 10m of twisted-pair phone line at 115200 baud without too much trouble.
doanerock wrote: Thu Feb 16, 2023 12:40 pm How much does it vary at diffrent baud rates.
Without going into the full math of transmission line theory, problems increase in direct proportion to frequency, and in proportion to the square of the distance they have to travel. In very broad terms, quadrupling the frequency is about as hard as doubling the distance.

That does give you a rough framework for tradeoffs though: if you want to double the distance, drop the frequency to 1/4th its current value and use that as a starting point for testing.

The major limiting factor is the ability to maintain clean enough rising and falling edges on the signal voltage. Those are slowed down by the parasitic resistance and capacitance of the cable over short distances, and become fuzzy due to propagation variance over very long distances (like transoceanic cables). If the square waves get rounded over too badly, or their amplitude gets attenuated too far by the effects of filtering, the assumptions a UART's RX pin uses to decide if the next bit is a 1 or a 0 stop being reliable.

The closest thing to an actual limit is one of the key assumptions of the 'lumped element discipline' of circuit design: the physical circuit must be 'small' compared to the wavelength of the fastest signal of interest. If that's true, we can pretend signals move from one end of the wire to the other instantly. When that isn't true, we have to switch over to radio frequency assumptions and deal with the fact that we have sine waves moving in the wires, and that a signal's voltage depends on the position where you measure it.

The typical rule of thumb is that 'small' means no more than 1/10th the wavelength of the fastest signal. A 115200 baud signal's wavelength is about 2km, so you can continue to use lumped-element assumptions for a 115200 baud signal out to about 200m.
doanerock wrote: Thu Feb 16, 2023 12:40 pm I remember hearing 12 inch wire once, is that correct?
That's beyond conservative. By the 1/10th wavelength rule, 12" counts as 'small' for frequencies up to 1GHz.

For practical circuits driven by a 3.3V microcontroller's GPIO pins, I'd put the frequency limit around 10MHz, with the major limiting factor being the amount of current the GPIO pins can deliver.

User avatar
doanerock
 
Posts: 28
Joined: Wed Oct 01, 2014 10:49 am

Re: TTL UART 3.3v cable length?

Post by doanerock »

Thanks for the insight. This was very helpful. I am just looking to have a GPS module next to the window and use it as a clock source on a on a apx 9 meter wire.

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

Return to “Microcontrollers”