Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RS-485 Comms

Status
Not open for further replies.

drkidd22

Member
Hello,
I inherited this rs-485 circuit and occasionally there are some communication issues. I think it might be due to to the operating voltage levels on the transceivers. One operates at 3.3Vdc and the other at 5Vdc. I looked at the datasheets and the input high and input low level match for the devices. Before I go into replacing components I was wondering if anyone here sees this being an issue. The communication baud rate is 195200 and the cable about 9ft long. Below is a sketch of the circuit and a snapshot of scope capture.
connection diagram.png
TEK00003.PNG
 
There is another problem. Pin 4 of j25. You do need a connection to ground on both ends. It can be chassis ground, but can't be a "loop".

Its differential signalling, but it does need something to be "differential about". You need a signal ground. https://www.csimn.com/CSI_pages/RS-485-FAQ.html

That signal ground can be chassis or earth.

If both ends are isolated, the the ground of the 3.3 and the ground of the 5V supply works,

So, the differential signal is either around the common of the 3.3 and 5.5 supplies OR chassis ground where the 3.3 i tied to chassis and the 5V is ties to chassis.

Just don;t use both.
 
Pin 4 is signal/reference ground for both sides and it is connected. They are not isolated, the 3.3V is actually a linear regulator from the same 5Vdc supply.
 
So, the black wire is redundant and it should not be there.

When you neasre the AB signals you should use A+B with channel B invert, ground of the scope should be ground of your circuist
A is one probe and B the other.

You should look at A-B.
 
I see what you mean about the black wire, but this is how power gets to the bottom board (pins 1 and 4), I don't show a wire on pin 1, but it's there on the same bundle.

The image of the scope are ch1 (A) and ch2 (B) and they are inverted, does it matter that one transceiver is at 3.3V and the other at 5V?
 
I see what you mean about the black wire, but this is how power gets to the bottom board (pins 1 and 4), I don't show a wire on pin 1, but it's there on the same bundle.

Remove the 750 ohm resistor and you still have a ground connection. You don't want two

The image of the scope are ch1 (A) and ch2 (B) and they are inverted, does it matter that one transceiver is at 3.3V and the other at 5V?

but that's not what you really want to see. You want to see A-B. Usually there is an invert on B available, In older scopes it was a pull to invert.

GND of the scope was/is connected to chassis.

Then the display is A+(-B) or A-B.

I had to deal with Rs485 once. There was a group trying to get RS485 to work between about 6 temperature controllers and another device. I came in one night when I wasn't bothered. and told them that their communications issue was fixed.

Labeling is messed up, reversed and backwards in the industry. They even say so.

I was trying to use RS232 with a Macintosh which had an RS422 port. most of the time (like connecting to a modem, a little cable re-wiring and it all works, but not for this real RS232 Rorzie stepper controller. I had to use a real converter.
 
I had a book on RS-232 interfacing that had excellent advice. They recommended throwing the documentation away. It will most likely be wrong and more confusing than helpful.

:banghead:

It was easy to figure out with a RS232 breakout box. the Ethernet tester gets a bit more expensive.
 
Personally, I'd remove all the 750 Ohms but refit a couple of somewhat higher value ones at one end, to keep a small DC bias on the bus.

The idea is to prevent noise and random characters being received if the bus is not being driven at either end.
 
The 750 are fine... But you only need them at one end... However!! 485 A and B are High, Low lines so check the polarities..

I thought A was pulled low and B was pulled high.. ( I fell down that rabbit hole years ago..)
 
As someone who uses RS-485 on a daily basis, perhaps I can be of some assistance.

The 750 ohm resistors are used as a fail-safe to ensure that the A and B transmission lines are held at a known voltage when there is no communication. The RS-485 specification calls for a minimum differential of 0.2V when the comms are idle, so your 750 ohm resistors are fine, even if you have them duplicated on both ends of the bus. This does cause a current leak, however, since the networks are the same on both the 5V system and the 3.3V system - there will always be current flowing from one to the other through the 485 lines which is no good. In cases like this the networks should either be tailored to their power supplies so that the voltage across the 121 ohm termination resistor is the same on both ends, or only exist on one end of the bus. However, this fail-safe is redundant in your application anyway because the MAX3485E already has a built-in failsafe feature. Therefore, your failsafe resistors are doing nothing but drawing an extra 3mA from your 5V supply and an extra 2mA from your 3.3V supply (roughly speaking at least -- the fail-safe networks existing on both ends of the bus with different voltage levels makes it a bit more complicated than this).

In regards to the common ground wire, while it is not strictly necessary since RS-485 is differential, it is usually still a good idea. This is usually done to ensure there is not a drastic difference in potential between two isolated systems which may cause the receiver inputs to see a voltage that is outside if its specified range. For example, if we designate the driver ground as 0V, the remote receiver may have a ground sitting at, say, -20V. The transmitted signal is at 5V with respect to the driver supply, but it's at 25V with respect to the ground of the receiver IC. This puts it outside of the 485 spec (and thus, the capability of the chips) of -7 to +12 volts, and that can damage the receiver. A common ground wire ensures that the grounds of each system are within a safe range to prevent over-voltage of the receiver inputs.

NOTE: I just re-read the comments and it has been mentioned that the driver and receiver are already on the same ground. Therefore the black wire in the schematic should indeed be removed, as KISS states. The black wire should only be connected if the transmitter and receiver chips are on different grounds.

As to the original question, yes - talking to a 3.3V receiver from a 5V driver can cause damage to the receiver IC (speaking from experience). I recommend incorporating level-shifters or, at the very least, a series 10 ohm resistor on the A and B lines to protect the receiver from the higher voltage driver.
 
Last edited:
Thank you all!, Got it fixed by removing the pull-up and pull-down resistors from the 3.3V circuit. Will use 5V devices on both ends with built in fail-safe for next revision and not use any pull-up pull-downs.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top