UART single direction long cable - Page 1
Forum section: electronics / projects

author: veryevil
author_rank: Unknown
timestamp: February 07, 2019, 02:11:23 pm
content: Hi, I'm looking to have two boards connected via about a meter of cable (unshielded) and I have a common gnd and a single data connection.I only want to send data one direction and was going to be using UART @ 115200 baud (maybe faster but I doubt it).I was looking for an alternative to using a full RS232 driver at both ends to give me some immunity, for cost and size reasons using a whole rs232 driver bothers me, but I haven't found any good driver ICs.I do have 12V on board so was wondering about just putting the 3v3 Tx side into a fet and boosting it to 12V and then having a window comparator on the other end to receive the 12v and make it 3v3 out again?Any thoughts or gotchas?Cheers

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 07, 2019, 02:27:41 pm
content: That should work fine.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 07, 2019, 02:36:52 pm
content: Without a schematic, hard to say. Talking about a single MOSFET, you'll need a pull-up, and a lot depends on the value of this pull-up. Use a small one, combined with a properly chosen series termination, and it's likely to be fairly good, but then you may have a power consumption issue. Too high, and this isworsethan not using anything, as your line is high impedance in the '1' state! Your existing 3V3 signal is, at least, a proper push-pull signal with around 20-30 ohms of transmitter impedance. Terminate it with a series 47 ohm resistor at the source, and off you go. If this somehow isn't robust enough, then consider a proper RS422 transceiver IC - they are widely available and will get you proper margin using differential pair.

author: Benta
author_rank: Super Contributor
timestamp: February 07, 2019, 03:20:52 pm
content: How do you manage flow control with only one wire? How do you know the receiver is ready to accept data?

author: ajb
author_rank: Super Contributor
timestamp: February 07, 2019, 03:39:46 pm
content: You shouldn't have any trouble in most environments. You might have trouble if this is inside of a system with a lot of motors and heavy loads flipping on and off or something, but 112k over a meter is not a big deal.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 07, 2019, 03:46:56 pm
content: There is little value in boosting the voltage over that distance. the reason RS232 uses +/-12 is to deal with ground shift over long distances.I'd just use a TTL buffer and ~100R damping resistor at the source, and a HCT TTL gate at the receive end.

author: veryevil
author_rank: Unknown
timestamp: February 12, 2019, 04:13:09 pm
content: Hi, if voltage boosting wouldn't help that much would something like this suffice at both ends?http://www.ti.com/product/sn74lvc1g17I'll be working with the 3V3 supply, this would give me some hysteresis and has a high drive strength.HCT family would need 5V supply.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 12, 2019, 04:44:10 pm
content: Yes, a schmitt trigger buffer at the receiver is a simple one and will improve reliability - a bit. Using buffers at both endsmayimprove ESD performance - a bit.However, are you sure you need such intermediate solution? No extra componentsat all(except series R which can be $0.001 0402 part) would be the simplest, and lowest cost BOM - and not much worse. If it doesn't work reliably for your case, are you sure a small improvement by using an external buffer would solve the problem?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: February 12, 2019, 04:59:00 pm
content: Quote from: mikeselectricstuff on February 07, 2019, 03:46:56 pmSome buffer / driver chip seems certainly advisable when adding cables, but if you're adding some driver chip, then why not simply use a bog standard RS-485 driver chip? (With proper termination resistors). These go from very cheap to very robust (Built -in ESD protectrion).They are easily obtainable in SOIC-8 or in DIP8 if you don't trust them and want to be able to easily replace them if they get damaged.RS-485 drivers are definately overkill for a 1m short cable, but I can't think of a good reason of not using them.If you use a slew-rate limited version you probably do not even have to "bother" with termination resistors, but always check your scope, and read up on some theory about these things.

author: ajb
author_rank: Super Contributor
timestamp: February 12, 2019, 05:05:02 pm
content: Quote from: Siwastaja on February 12, 2019, 04:44:10 pmThis is a good point, if you do run into signal integrity issues, then it's important to figure out what the actual issue is. For instance, if your problem is caused by difference in ground potential then maybe opto-isolation is a better solution than buffering.Quote from: Doctorandus_P on February 12, 2019, 04:59:00 pmAt 115kbaud and 1m of cable, the cable length is like 0.0005 symbol periods, so you won't REALLY need termination at all except for EMI.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: February 12, 2019, 05:27:39 pm
content: @ajb, Bit fuzzy in my head,didn't do the math, tnx for setting it straight.Optocouplers are just as much overkill as RS-485 drivers, but they are also cheap.(But with cheap optocouplers the 115k2 baud may become problematic).With MIDI an output switches a current / voltage, which goes through an optocoupler at the "other" end of the cable.Because the diode in the optocoupler needs a fair bit of current to turn on this also provides for signal integrity over the cable. It becomes a current loop. By using resistors on both end of the cable you improve robustness against ESD events and accidentally applied external voltages. As a cricuit you can use something similar to:

author: technix
author_rank: Super Contributor
timestamp: February 13, 2019, 05:51:54 am
content: If you are paranoid with interference, use a stretch of TOSLINK. That is optical transmission, which is immune to EM interference and allow you to break the ground since it is inherently isolated. TOSLINK are those cheap plastic optical fibers used in audiovisual equipment. They are usually specified at 16Mbps or higher, so you can run 115200 bps over that (or even 2Mbps if you dare to)