RS485: two transceivers

I have two CPUs, master and slave. They are (will be, actually) connected with one SN75176B IC on each side, with two wires connecting them.

After reset, the master will be in transmit mode, slave in recv mode.

When the master sends a command to slave, the master will switch into recv mode and slave into transmit mode.

Now, what happens while they are switching? At one moment, both sides may be in input mode, and the wires will float, maybe generating a start impulse.

How is this situation usually handled?

I could probably solve this with software, by waiting some time, then discarding the byte received, if any. The slave would have to wait even longer and then start sending.

Reply to
aleksa
Loading thread data ...

Do I just place a pull-up one one line, and a pull-down on the other?

Reply to
aleksa

I've found this

Biasing an RS-485 Network

formatting link

Reply to
aleksa

Or maybe I could just use SN75LBC176D IC.

Ok, that was me, talking to myself.

Reply to
aleksa

Sorry to interrupt that conversation. ;-)

Yes, biasing is the solution for that problem and using fail safe receivers is always a good thing. Don't forget the terminators.

You must also make sure the common mode voltage stays within limits. Most systems use a ground wire.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

Another Armenia, Belgium ... the weak innocents who always seem to be
 Click to see the full signature
Reply to
Stef

You mean I should use biasing resistors in addition to a fail-safe IC?

BTW, to anyone starting with RS485:

formatting link

Reply to
aleksa

Am 14.04.2011 13:13, schrieb aleksa:

For such systems, i use pull-up and pull down as you write and termination from A to B.

Pull up and down is something like 390 Ohms or 1 K and termination is

120 Ohms.

Best regards

Stefan DF9BI

Reply to
Stefan Brröring

Yes. ISTR 4.7K was a fairly common value. Also don't forget that

1) For a bus longer than about 0.1 bits, termination resistors are required on both ends of the bus. 2) A signal ground is also required. RS485 receivers can typically only deal with a common-mode voltage of 7-12V.
--
Grant Edwards               grant.b.edwards        Yow! Here I am in 53
                                  at               B.C. and all I want is a
 Click to see the full signature
Reply to
Grant Edwards

No, I don't say you should. But it would be my preference if I have the freedom to pick te parts. ;-)

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

You will live a long, healthy, happy life and make bags of money.
Reply to
Stef

If you have signal ground on both sides, you should connect. If not, don´t care, should work also without GND.

Best regards

Stefan DF9BI

Reply to
Stefan

No, that is a common misconception. RS-482/485 is a *three* wire interface.

If you connect only the data lines it will work in most cases, when the nodes are in the same rack / room / building or where a common ground is provided anyway.

But, as Grant wrote, if you exceed the common-mode tolerance of the receivers it will not work anymore ...

-- Roberto Waltman

[ Please reply to the group. Return address is invalid ]
Reply to
Roberto Waltman

In my experience it often doesn't.

--
Grant Edwards               grant.b.edwards        Yow! Please come home with
                                  at               me ... I have Tylenol!!
 Click to see the full signature
Reply to
Grant Edwards

And I've seen it fail many times.

--
Grant Edwards               grant.b.edwards        Yow! Here I am at the flea
                                  at               market but nobody is buying
 Click to see the full signature
Reply to
Grant Edwards

Biasing the lines idle avoids problems but with little noise immunity.

A better solution is to use a protocol which is tolerant of spurious characters received outside defined messages and after enabling a transmitter delay transmission by at least one character time which allows any spuriously triggered character to be completely received.

Another solution is to never have 'both' sides in input mode. There is no reason why both sides can not drive the bus simultaneously to the same level. So arrange for the initiator to linger driving the bus and for the responder to delay transmission after starting to drive the bus to guarantee an overlap.

For the highest reliability combine all three solutions, remember that if the responder fails to receive a valid message it will leave the bus floating until the initiator attempts recovery.

Reply to
nospam

That's the most common solution. I suggest that you read through the B&B RS-485 application note:

formatting link

(The link may need to be reassembled).

Mark Borgerson

Reply to
Mark Borgerson

Should be on the required reading list.

For many (most?) modern newsreaders, putting the link in angle brackets

prevents the line break.

Now if I could just understand why UARTs idle on mark 'high' and both

232 and the 422/485 'A' line idle on mark 'low' but the standard symbology for 422/485 drivers has the inversion circle on the 'B' line.
--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

That path leads to madness -- not even silicon and equipment vendors can agree on which terminal is "A" and which is "B".

It's best not to try to figure out RS485/RS422 polarities. No matter how much thought and research you put it into it your chances of it coming out right are always 50-50.

Just build something, and if it doesn't work swap the two.

[And I'm not entirely joking.]
--
Grant Edwards               grant.b.edwards        Yow! I'm EMOTIONAL
                                  at               now because I have
 Click to see the full signature
Reply to
Grant Edwards

The important thing is to connect the inverted signal to your A line. This is especially important for applications where the device can switch between balanced and single ended modes. Single ended protocols use the inverted signal only and that should be the same pin as the A signal on balanced protocols.

Rick

Reply to
rickman

Because all line drivers inverted signals so that receivers could pull up the input to detect Break conditions (no cable). Which is useful that when connected a driven signal denotes a connection (hopefully correctly pinned out in all respects). This came about with creating standards for modems that internal bodies set (CCITT at the time now ITU-T), that used the lower level 232 standard as its signalling levels. Hence the confusion people have about the difference between RS232 and V24 over the years. Let alone the distance it can be driven confusions.

But then again...

These seemed to have been worked out on just the signalling basis and not the WHOLE communications link because no other body easily adopted it as the common signalling method of a higher model correctly. That is even down to defining common connectors and signal relationships.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
 Click to see the full signature
Reply to
Paul

This is history from the time of mechanical teletypewriters.

In a teletypewriter circuit, both keyboards and printer solenoids are connected in series with the power supply into a current loop. In idling state, the current is flowing, and everything written on either keyboard breaks the current on both printers, printing on both.

The CCITT names for the asynchronous signal states are 'travail' (work, mark) and 'repos' (rest, space).

When the interfaces went electronic, it was natural to pick high for the current flowing. It needed just one transistor to switch the current in the loop.

--
Tauno Voipio,
old enough, so having worked with them ...
 Click to see the full signature
Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.