Practical Circuit for RS422 and RS485

More
01 Feb 2024 17:27 #292144 by blazini36
Not really a "Driver Board" question but this is the best place to get into general electronics.

I'm working on an interface PCB for a single board computer, it has a single UART with flow control. RS485 is popular for VFDs and stuff but I tend to like to use RS422 for non-standard stuff. Most RS485 full duplex transceivers are also labeled for use with RS422 but most RS485 is half duplex. The half duplex RS485 chips always show an internal schematic of the non-inverting and inverting driver and receiver pins just being tied together internally so I think this works as a jumper selectable RS422/RS485 full/half duplex arrangement. Hoping somebody who plays with alot of serial will weigh in (paging PCW)

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 18:23 #292150 by PCW
A few suggestions if you want this to be universal:

If you need RE (you don't with Mesa UARTS since they can mask echos during Xmit)
you need a pullup on RD so the RXdata takes an idle state when not driven.

For RS-485 use you need to pullup (to 5V) on RX+ and pulldown  (to gnd) on
RX- so the have a valid idle state when not driven by any RS-485 device.
These are typically 620 Ohm or so and do not  materially interfere with RS-422 use.
For low speed links like Modbus on VFDs its better to be able to disconnect the ~100 Ohm
termination. Also if you add the 620 Ohm pullups and pulldowns you should to change
the termination resistor so the Thevenin equivalent is ~100 Ohms.
 

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 18:56 #292154 by blazini36
Lol, I knew this was gonna get a bit more complicated. Gonna try to work this out so I can limit the amount of jumpers in use......

I don't need RTS, or CTS but it's there on the GPIO so I figured I may as well. Not sure about you but I like to reuse chips and schematics to make my life easier and while I don't have a Mesa use for RS485 at the moment, since I've been fond of messing with a 7i92 it might find it's way onto something eventually. SSerial RS422 is alot simpler so I've got that covered.

By "you need a pullup on RD", do you mean RO (Reciever Output) prior to the level shifter?

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 19:06 #292155 by PCW
Yes, RO since its floated when /RE is not asserted.

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 19:51 #292158 by blazini36
Not sure if I can properly route the pairs for even skew with this setup, though I'm not sure how much it matters <2.5Mbaud.

I think this works with just adding a single extra jumper for the termination resistor, but I'm not sure how to calculate the Thevenin for something like this.....Think it's just another 620r resistor?

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 20:22 #292160 by PCW
The route length is immaterial here, an inch
difference  is only in the 100 -200 Pico second range.

The differential termination impedance is basically the main
(~100 Ohm) termination resistance in parallel with  1240 Ohms
(just imagine the pullup and pulldown  resistors connected together instead
of  +5V and GND at the non RX ends so as far as differential impedance
goes, they are in series. We usually use 120 Ohms (this is a bit high but
% overshoot from mismatched termination is only about 50% of the error,
and I would rather have a bit of overshoot and a larger signal)

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 21:03 #292163 by blazini36
I always try to match the pairs best I can, helps avoid issues down the road. I don't go overboard with stuff like this though.

The differential termination impedance is basically the main
(~100 Ohm) termination resistance in parallel with  1240 Ohms
(just imagine the pullup and pulldown  resistors connected together instead
of  +5V and GND 

Yeah that's pretty much where I was losing it, couldn't imagine how the pull up and pull down equated to a series resistance but if they are basically treated as they are directly in series it's much easier to wrap my head around.

So 120r for the jumpered terminator? Easy enough to swap resistors one the footprint is on the PCB, much easier than cutting traces and bodging wires if the circuit is incorrect.

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 21:08 #292164 by PCW
Also remember that with stiff RS-422 drivers you can get close to 5V across
the main termination resistor so no 0603's  (we usually use 1206 for this)

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 21:31 #292167 by blazini36
Hey good call, I use 0804 for almost everything unless it's obvious I can't get a capacitance or current rating in that size, I'll use 1206.

Quick OT question since I'm thinking about differential signals. I have heard multiple times that "differential transmitters, 74 series, etc.... don't have the drive strength to run external step drivers." I think the clearpath manual actually warns against it IIRC. I usually use a SN75174 which I think is EOL so I have to find something else but I never had any problems with it, Clearpaths, optocoupled drivers etc. Any thoughts?

Please Log in or Create an account to join the conversation.

More
01 Feb 2024 21:57 - 01 Feb 2024 21:58 #292169 by PCW
For differential drivers we use  ISL32172/ISL32174
Since they have full 5V output swing and lots of current
output capability. Parts like the MAX3042 also have 5V
outputs, but are typically much more expensive.

Regular 75174s, 34C87s etc don't have 5V output swings
so are marginal driving typical opto-coupled step driver
inputs.
Last edit: 01 Feb 2024 21:58 by PCW.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.075 seconds
Powered by Kunena Forum