Author Topic: UART single direction long cable  (Read 2335 times)

0 Members and 1 Guest are viewing this topic.

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
UART single direction long cable
« on: February 07, 2019, 02:11:23 pm »
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

 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9318
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: UART single direction long cable
« Reply #1 on: February 07, 2019, 02:27:41 pm »
That should work fine.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: UART single direction long cable
« Reply #2 on: February 07, 2019, 02:36:52 pm »
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 is worse than 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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: UART single direction long cable
« Reply #3 on: February 07, 2019, 03:20:52 pm »
How do you manage flow control with only one wire? How do you know the receiver is ready to accept data?
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2785
  • Country: us
Re: UART single direction long cable
« Reply #4 on: February 07, 2019, 03:39:46 pm »
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.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14117
  • Country: gb
    • Mike's Electric Stuff
Re: UART single direction long cable
« Reply #5 on: February 07, 2019, 03:46:56 pm »
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.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: UART single direction long cable
« Reply #6 on: February 12, 2019, 04:13:09 pm »
Hi, if voltage boosting wouldn't help that much would something like this suffice at both ends?

http://www.ti.com/product/sn74lvc1g17

I'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.

 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: UART single direction long cable
« Reply #7 on: February 12, 2019, 04:44:10 pm »
Yes, a schmitt trigger buffer at the receiver is a simple one and will improve reliability - a bit. Using buffers at both ends may improve ESD performance - a bit.

However, are you sure you need such intermediate solution? No extra components at 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?
« Last Edit: February 12, 2019, 04:45:49 pm by Siwastaja »
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: UART single direction long cable
« Reply #8 on: February 12, 2019, 04:59:00 pm »
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.

Some 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.
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2785
  • Country: us
Re: UART single direction long cable
« Reply #9 on: February 12, 2019, 05:05:02 pm »
However, are you sure you need such intermediate solution? No extra components at 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?

This 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.

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.
At 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.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: UART single direction long cable
« Reply #10 on: February 12, 2019, 05:27:39 pm »
@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:

« Last Edit: February 12, 2019, 05:31:18 pm by Doctorandus_P »
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3508
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: UART single direction long cable
« Reply #11 on: February 13, 2019, 05:51:54 am »
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)
« Last Edit: February 13, 2019, 05:55:23 am by technix »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf