Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I would like to avoid using RS-232 converters between two microcontrollers on two different boards. For various reasons, only UARTs are supported, e.g. no SPI or I2C, and I will be using CAT5E cable to RJ45 jacks between the boards. The data rate will be 115200bps, possibly up to 921600bps. Ground is connected along with the UART signals.

While I currently have it working at the lengths I need it, for my own education, is there a way to estimate the maximum cable length at which this would be reliable?

share|improve this question
    
This lammertbies.nl/comm/info/RS-232_specs.html may be helpful "If for example UTP CAT-5 cable is used with a typical capacitance of 17 pF/ft, the maximum allowed cable length is 147 feet." –  kenny May 15 '12 at 15:01
1  
Real RS232 has a voltage swing of more than 10 Volt between mark and space state. And the 147 feet is for 19200 baud only. OP is talking about 3V3 UART and 115200 to 921600 baud: This will work only with relatively short cables. –  Turbo J May 15 '12 at 18:04
    
May I suggest RS422 tranceivers? They would fit CAT5E twisted pair cables much better. –  Turbo J May 15 '12 at 18:09
    
Not an option, unfortunately. –  QuestionMan May 15 '12 at 19:20

2 Answers 2

up vote 3 down vote accepted

There is no single safe answer. It has a lot to do with the length of the cable, surrounding electrical noise, and how fast you want to go. Ethernet uses CAT5 cable to transmit at 10 Mbit/s for the slowest variety, so 1 Mbit/s is easily doable if you take the proper precautions. Note that with ethernet each signal gets its own twisted pair, and each pair is carefully terminated at the characteristic impedance of the cable at each end. Each pair is driven differentially and interpreted differentially, and is also designed so that it can't cause ground loops.

If you do all these thing, you can transmit 1 Mbit/s data on CAT5 cable for long distances, like 1000 meters. As you do less of these things, the usable distance will go down. If it's just board to board in the same chassis, for example, then you probably don't need to do much special. If you're going outside the unit, then differential line drivers and receivers could be useful.

Try something in your setup and look at the signals at the receiving end to get some idea of the noise margin, adjust as needed. Maybe use a protocol that can detect and recover from errors, and keep track of how often that is happening. There are too many ways to list here without more information.

share|improve this answer
    
Just because you can get 145m out of Ethernet does not mean you would get the same out of a 3.3V TTL signal down the same cable just because you are using a lower bit rate, see explanation in my answer. –  Jason Morgan May 15 '12 at 21:25
    
@Jason: Note that I didn't say you would. I said you could get long distances with the proper precautions, such as differential line drivers and receivers and terminated ends. –  Olin Lathrop May 15 '12 at 22:55
    
@Olion: From your post you seem to state it is more about the characteristics of a cable, rather than why a 3.3V TTL won't travel far down it. To me it reads as a suggestion to buy a good cable, which we both know is wrong. –  Jason Morgan May 16 '12 at 5:59

Ethernet uses differential signalling, a TTL signal is single ended.

Ethernet uses pre-emphasis, TTL does not.

Ethernet is current mode, TTL is voltage mode.

Ethernet uses a modulation tachnique that reduces the number of edges, your TTL might not (standard ASYNC certainly do not)

Ethernet driver and receiver are impedance matched to the cable, unless carefully designed, TTL would not be (and if it were, then it would not be TTL!)

Ethernet uses a symetrical signal (by use of scambling) to create an even 1's density. ASYNC serial has a built in bias which charges the cable and has to be be overcome to get a signal out the other end.

For these reasons, just because you can get 145m out of Ethernet at 1Gbps does not mean you would get the same (or even 1000 times less) out of a 3.3V TTL signal down the same cable.

I recommend using a differential signalling driver such as RS422, that is what it is designed for. Indeed RS422, though run at a lower voltage is better for long runs because of the differential signalling (RS232 is single ended),
Also, the drivers and receivers do clever things to improve the quality of edges such as pre-emphasis.

share|improve this answer
    
The OP already had stated 3 hours before your answer that RS422 transceivers were not an option. –  tcrosley May 15 '12 at 23:26
    
Yes, I can read. I can still recommend the correct solution. Just because the poster does not like to hear the truth, it does not mean that it should not be told. –  Jason Morgan May 16 '12 at 5:55
1  
Why are you calling it TTL all the time? Title says 3.3V, so it's definitely not TTL. TTL drive has very asymmetrical sink/source capabilities, while HCMOS is symmetrical. Can make a world of difference driving a cable. –  stevenvh May 16 '12 at 9:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.