EmbeddedRelated.com
Forums

RS485: two transceivers

Started by aleksa April 14, 2011
Stefan wrote:
>Grant Edwards wrote: >> 2) A signal ground is also required. RS485 receivers can typically >> only deal with a common-mode voltage of 7-12V. >> >If you have signal ground on both sides, you should connect. If not, >don�t care, should work also without GND.
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 ]
On 2011-04-14, Stefan <df9bi@amsat.org> wrote:
>> >> 2) A signal ground is also required. RS485 receivers can typically >> only deal with a common-mode voltage of 7-12V. >> > > If you have signal ground on both sides, you should connect. If not, > don?t care, should work also without GND.
In my experience it often doesn't. -- Grant Edwards grant.b.edwards Yow! Please come home with at me ... I have Tylenol!! gmail.com
On 2011-04-14, Roberto Waltman <usenet@rwaltman.com> wrote:
> Stefan wrote: >>Grant Edwards wrote: >>> 2) A signal ground is also required. RS485 receivers can typically >>> only deal with a common-mode voltage of 7-12V. >> >>If you have signal ground on both sides, you should connect. If not, >>don?t care, should work also without GND. > > 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 ...
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 gmail.com my urine sample bottles ...
"aleksa" <aleksazr@gmail.com> wrote:

>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.
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.
In article <io6kto$6p8$1@dont-email.me>, aleksazr@gmail.com says...
> > "aleksa" <aleksazr@gmail.com> wrote in message news:io6k61$upc$1@dont-email.me... > >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. > > > > Do I just place a pull-up one one line, and a pull-down on the other?
That's the most common solution. I suggest that you read through the B&B RS-485 application note: http://www.bb-elec.com/tech_articles/rs422_485 _app_note/table_of_contents.asp (The link may need to be reassembled). Mark Borgerson
On Thu, 14 Apr 2011 12:15:01 -0700, Mark Borgerson
<mborgerson@comcast.net> wrote:

>In article <io6kto$6p8$1@dont-email.me>, aleksazr@gmail.com says... >> >> "aleksa" <aleksazr@gmail.com> wrote in message news:io6k61$upc$1@dont-email.me... >> >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. >> > >> >> Do I just place a pull-up one one line, and a pull-down on the other? > >That's the most common solution. I suggest that you read through the >B&B RS-485 application note: > >http://www.bb-elec.com/tech_articles/rs422_485 >_app_note/table_of_contents.asp
Should be on the required reading list.
>(The link may need to be reassembled).
For many (most?) modern newsreaders, putting the link in angle brackets <http://www.bb-elec.com/tech_articles/rs422_485_app_note/table_of_contents.asp> 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
On 2011-04-14, Rich Webb <bbew.ar@mapson.nozirev.ten> wrote:

> 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.
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 gmail.com MERCHANDISING CLOUT!!
On Apr 14, 3:53=A0pm, Grant Edwards <inva...@invalid.invalid> wrote:
> On 2011-04-14, Rich Webb <bbew...@mapson.nozirev.ten> wrote: > > > 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. > > 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. =A0No 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.]G CLOUT!!
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
In article <jhieq6paekk7ioevigmgam02lh3igpf6vu@4ax.com>, 
bbew.ar@mapson.nozirev.ten says...
> > On Thu, 14 Apr 2011 12:15:01 -0700, Mark Borgerson > <mborgerson@comcast.net> wrote: > > >In article <io6kto$6p8$1@dont-email.me>, aleksazr@gmail.com says... > >> > >> "aleksa" <aleksazr@gmail.com> wrote in message news:io6k61$upc$1@dont-email.me... > >> >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. > >> > > >> > >> Do I just place a pull-up one one line, and a pull-down on the other? > > > >That's the most common solution. I suggest that you read through the > >B&B RS-485 application note: > > > >http://www.bb-elec.com/tech_articles/rs422_485 > >_app_note/table_of_contents.asp > > Should be on the required reading list. > > >(The link may need to be reassembled). > > For many (most?) modern newsreaders, putting the link in angle brackets > <http://www.bb-elec.com/tech_articles/rs422_485_app_note/table_of_contents.asp> > prevents the line break. > > Now if I could just understand why UARTs idle on mark 'high' and both > 232
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...
>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.
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 <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny <http://www.badweb.org.uk/> For those web sites you hate
On 14.4.11 10:37 , Rich Webb wrote:
> prevents the line break. > > Now if I could just understand why UARTs idle on mark 'high'
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 ...