Shop OBEX P1 Docs P2 Docs Learn Events
Question about RS-485 — Parallax Forums

Question about RS-485

bte2bte2 Posts: 154
edited 2014-09-04 13:51 in General Discussion
Anybody have any hints or tips to share regarding connecting a 3.3v RS-485 differential driver to a 5v device(s) on the same bus?

I want to build a piece of test equipment using a Propeller but the existing bus is connected to 5v powered devices, and I'm not sure if there are any pitfalls. I contemplated using logic level converters to interface the Propeller to a 5v driver but don't know if that is overkill (yet).

I'm looking at the Exar SP3072 for the chip, and their app note addresses an issue if the receivers AB lines are pulled up to 5v with no termination, but I am wondering if anybody out here could offer anything else for me to consider.

Thanks in advance! -bryan

Datasheet- http://www.exar.com/common/content/document.ashx?id=1399

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-08-30 12:12
    I have used 3.3V drivers on a short (~50') 5V bus at 115Kb/sec with no problems sending or receiving data, but am not sure how well that would work at longer distances. The RS485 drivers are pretty tolerant of over voltage levels on the bus so receiving data is not a problem, however sending might be. If you have 5V available on the propeller board you could use a 5V driver with a 4.7K resistor between the propeller pin and the driver I/O pin.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-08-30 23:22
    If you are using RS485 or RS422, the actual twisted pair doesn't care if you are mixing transceivers that are powered by 3.3v or 5.0v.

    It is just the Tx and Rx TTL logic input/output that desire one or the other. Baud rate and distance performance should be about the same.

    And I have adapted 5.0v TTL logic RS485 trancievers to use with the Propeller as they are just easier to buy locally. Yes, adding a 4.7K resistor to Propeller inputs to protect it will work. You do have to be careful to not have long wires to the Tx and Rx as cross-talk between the two can be a problem. Don't run them parallel and next to each other.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-08-31 00:23
    If you are using RS485 or RS422, the actual twisted pair doesn't care if you are mixing transceivers that are powered by 3.3v or 5.0v.
    While that may be true, kwinn's comments still hold sway. The reason is that 3.3V transceivers output less of a differential voltage swing than do 5V transceivers. So their reliable transmission distance may be more limited. OTOH, those distances may well be in the tens of hundreds of feet, regardless of the transceiver mix chosen.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-08-31 04:12
    The transceivers don't care just as long as it's within their common-mode range and that the differential receive threshold is greater than 200mv, so there is no problem. However I do use 5V transceivers but I just use 2 I/O, one for the common TE/RE but with a 10K pulldown to ensure the transmitter does not turn on before software gets to set the TE line, and the other I/O is common for RX and TX although I use a 10K resistor in between the RX pin and the I/O. No need to use a jittery full-duplex driver, stick to a jitter-free half-duplex driver and if your baud rate is low that could just as easily be one written in Spin.

    RT--+
    10K
    <RXD.485
    ....|
    >TXD.485

    TE
    +
    >TE.485,RE.485
    GND=====10K---|

  • bte2bte2 Posts: 154
    edited 2014-08-31 08:48
    Thank you all for the replies! It is a little tricky to experiment with different circuits because the machinery is 100 miles away, so I have to take a leap of faith (or two)(or maybe even three). I am hoping I don't coaster the board I make because that will gobble up too much time. I was a little concerned about some goofy latchup scenario where it stops working 5 minutes after I leave there ;-)

    Thanks again!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-09-01 06:28
    I suspect the biggest challenges to long distance RS422/RS485 are [a] lightning, and differences in ground.

    Recently, I have gotten into considering fiber optic as a very reasonable alternative to both. If you really are going miles on twisted pairs, fiber optic cable as an alternative might eliminating having to dread rushing out for service calls after every passing thunderstorm.

    This link seems to be very good and have reasonable prices. http://www.fiberstore.com/

    http://www.fiberstore.com/c/rs485-converters_1054
  • DanielXIangDanielXIang Posts: 1
    edited 2014-09-02 00:30
    I suspect the biggest challenges to long distance RS422/RS485 are [a] lightning, and differences in ground.

    Recently, I have gotten into considering fiber optic as a very reasonable alternative to both. If you really are going miles on twisted pairs, fiber optic cable as an alternative might eliminating having to dread rushing out for service calls after every passing thunderstorm.

    This link seems to be very good and have reasonable prices. http://www.fiberstore.com/

    http://www.fiberstore.com/c/rs485-converters_1054

    you are right @ Loopy Byteloose
  • MicksterMickster Posts: 2,621
    edited 2014-09-03 00:41
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-09-03 02:29
    Wireless? Well, antennas and lighting generally are in conflict for a 24/7 critical communications. And there is the second concern of snooping potential that might lead to some other wireless unit hacking into your devices.

    Wireless is great where mobity is needed and your habits are less than predicatable. It just fits a different set of parameters.
  • Heater.Heater. Posts: 21,230
    edited 2014-09-03 03:55
    Loopy,
    ...antennas and lighting generally are in conflict for a 24/7 critical communications.
    I guess it depends what you mean by "24/7 critical" but evidence would suggest this is not a huge problem.

    We have been using wireless for a century now. The world is covered in broadcast radio and TV transmitters with huge tall antenna systems not to mention the forest of domestic TV antennas that receive those broadcasts.

    There are services like ambulance, police, taxi and so on for whom wireless communication is critical.

    Today we have many millions of mobile phone cell towers all around the world. The cell phone system is now pretty critical.

    All these wireless systems live in a sea of storms and lightning and they seem to be amazingly reliable.

    It's not as if long cable runs cannot be susceptible to lightning attacks either.

    As it happens we are looking for wireless solutions to some almost critical applications. I did consider the lightning issues as well. At the end of the day though if the solution is a least as reliable as current wired systems we are good to go.

    Snooping is an issue. Or in our case the injection of fake sensor data would be annoying. However wireless security has improved a lot and one can ways layer a VPN or such like over the channel as well. Again it's not as if cables have not been sniffed before.
  • MicksterMickster Posts: 2,621
    edited 2014-09-03 05:28
    I have been producing wireless machine control systems since January 2012 and they have been extremely reliable and well received. I even have them in "big auto" and currently in discussions to replace wired systems on existing machinery....but then again I was the "fool" (according to "PLC father", Dick Morley who contacted me via Compuserve many years ago) who was installing "office grade" PC-Based control systems on process machinery back in 1986!


    http://www.automationworld.com/networking-amp-connectivity/why-wireless-sensor-networks-are-everywhere-almost
  • Jimmy BushJimmy Bush Posts: 2
    edited 2014-09-04 01:55
    I agree with you, I have ever bought some items from this Fiberstore, the quality is good indeed.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-09-04 09:15
    I tend to take the stances that a good engineer will acknowledge that twisted pair, fiber optic, and wireless are all good with different superior attributes for different situations.

    About the only choices that I think are poor are the traditional RS232, the traditional parallel cable, and maybe even the USB serial.

    USB tends to be called upon to do many things that can be done in better ways, especially when the user begins to desire to communicate over distances beyond 25 feet.

    Many users that turn to RS232 are unaware that RS422 full-duplex is better and even simpler to construct. There is just a huge corpus of DIY examples using RS232 that overwhelms people from learning better alternatives.

    Fiber optic is ideal for outdoor use where a secure private line is the goal, but it has to be done right. Fiber optic won't tolerate kinks and stretching of the cable. Many good cables have a steel wire cable to eliminate stretch when hung pole-to-pole.

    Wireless has a big array of choices; X-bee, Bluetooth, Wifi, and more.

    ++++++++++
    I only mentioned fiber optic because the OP said something about 10 miles distance. Not sure if he really meant that as RS485/RS422 twisted pairs could only do that with several repeater stations.

    There are enhancements to the RS485/422 termination that can improve performance and protection, including lightning arrestors. Since I have never gone far into the outdoors with twisted pairs, I have always just used a 300ohm resistor. But that certainly can be enhanced.
  • Heater.Heater. Posts: 21,230
    edited 2014-09-04 11:09
    Loopy,
    About the only choices that I think are poor are the traditional RS232, the traditional parallel cable, and maybe even the USB serial.
    Hmmm...In my experience you are right. The parallel port thing has proven very unreliable many times. USB of course is an abomination of complexity. Mostly fails because of software problems. USB over long distances is a no-no.
    Many users that turn to RS232 are unaware that RS422 full-duplex is better and even simpler to construct.
    Here I might disagree. I have seen a number of RS422/485 links blown for various reasons. For example a bad mismatch of ground potentials. I have never seen an RS232 link fail.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-09-04 11:17
    heater wrote:
    USB over long distances is a no-no.
    I've had excellent results from USB extenders, which convert the USB and transmit it over CAT5, then back again at the other end. The powered end even steps up the +5V to a higher value to minimize resistive losses in the cable.

    -Phil
  • Heater.Heater. Posts: 21,230
    edited 2014-09-04 11:27
    Phil,

    Interesting, do you have any links to such USB to CAT5 extenders?

    Still, that is just adding more complexity to the already over complex USB.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-09-04 11:31
    FTDI has an extremely nice USB to RS-485/422 dongle that will provide a distance line from a USB to actually programing a Propeller that is adapted to 3 twisted pairs at the other end. It might even work at 3Mbaud for data transfer.

    The USB over distance seems to actually be converting to twisted-pair drivers, and then back to USB (which has to be converted to ttl serial for the Propeller). Seems to me another gadget that is adding an adapter on top of an adapter and requiring a more complex USB at the Propeller end.

    Yes it works. But you have more devices doing more things just to get there. At the very least, it consumes more power than necessary.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-09-04 13:51
    heater wrote:
    Phil, Interesting, do you have any links to such USB to CAT5 extenders?

    Just Google usb extender, and you'll find a bunch of them.

    -Phil
Sign In or Register to comment.