Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

RS485 w/ MAX481, terminators not needed?

RS485 w/ MAX481, terminators not needed?

2004-10-01 by James Russo

Hello Everyone,

    I am working on getting two MAVRIC-II (Mega128) boards talking using 
RS485 (MAX481 to uart1). I am using a short segment of  (<5feet) of 3 
twisted wires (A,B,Gnd). My problem is that with the terminators 
installed on either node, my data output from the RS481 is not high when 
the there is no driver active on the bus. This causes the uart to 
constantly see a start bit, and then return a 0 after every byte 
received. However, if I remove the terminators on both everything seems 
to work as expected.

According to the spec sheet for the 481, the DO pin should be high when 
the "inputs are open"? I have a feeling it has to do with the very short 
RS485 run with just two nodes on it and the involved resistances, but 
hopefully someone else has more experience and can give me a pointer.

Thanks,

-james

RE: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-01 by Lasse Madsen

Hi James
 
I have a suggestion for you not a solution to your particular problem.
 
I've used RS485 for a long time and I've found the (more expensive) auto
bias self terminating IC's from maxim to work perfectly where others
failed!
 
/Regards
Lasse M.
Show quoted textHide quoted text
-----Original Message-----
From: James Russo [mailto:jr@halo3.net] 
Sent: 1. oktober 2004 16:03
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] RS485 w/ MAX481, terminators not needed?
 
Hello Everyone,

    I am working on getting two MAVRIC-II (Mega128) boards talking using

RS485 (MAX481 to uart1). I am using a short segment of  (<5feet) of 3 
twisted wires (A,B,Gnd). My problem is that with the terminators 
installed on either node, my data output from the RS481 is not high when

the there is no driver active on the bus. This causes the uart to 
constantly see a start bit, and then return a 0 after every byte 
received. However, if I remove the terminators on both everything seems 
to work as expected.

According to the spec sheet for the 481, the DO pin should be high when 
the "inputs are open"? I have a feeling it has to do with the very short

RS485 run with just two nodes on it and the involved resistances, but 
hopefully someone else has more experience and can give me a pointer.

Thanks,

-james




Yahoo! Groups Sponsor


ADVERTISEMENT
 
<http://us.ard.yahoo.com/SIG=129b8gskm/M=298184.5285298.6392945.3001176/
D=groups/S=1706554205:HM/EXP=1096725818/A=2319498/R=0/SIG=11thfntfp/*htt
p:/www.netflix.com/Default?mqso=60185352&partid=5285298> click here

 
<http://us.adserver.yahoo.com/l?M=298184.5285298.6392945.3001176/D=group
s/S=:HM/A=2319498/rand=304038671> 
 
  _____  

Yahoo! Groups Links
*         To visit your group on the web, go to:
http://groups.yahoo.com/group/AVR-Chat/
  
*         To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
<mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
  
*         Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/>  Service.

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-01 by James Russo

Thanks for the reply. Right now I am stuck with 481 on the board, but it 
seems like it will meet my requirements. I've been reading some more 
about this throughout the day and it seems that having to bias the bus 
(using a pullup and pulldown) configuration is quite commonly done.

-jr

Lasse Madsen wrote:
Show quoted textHide quoted text
> Hi James
>
> I have a suggestion for you not a solution to your particular problem.
>
> I’ve used RS485 for a long time and I’ve found the (more expensive) 
> auto bias self terminating IC’s from maxim to work perfectly where 
> others failed!
>
> /Regards
>
> Lasse M.
>
> -----Original Message-----
> *From:* James Russo [mailto:jr@halo3.net]
> *Sent**:* 1. oktober 2004 16:03
> *To:* AVR-Chat@yahoogroups.com
> *Subject:* [AVR-Chat] RS485 w/ MAX481, terminators not needed?
>
> Hello Everyone,
>
> I am working on getting two MAVRIC-II (Mega128) boards talking using
> RS485 (MAX481 to uart1). I am using a short segment of (<5feet) of 3
> twisted wires (A,B,Gnd). My problem is that with the terminators
> installed on either node, my data output from the RS481 is not high when
> the there is no driver active on the bus. This causes the uart to
> constantly see a start bit, and then return a 0 after every byte
> received. However, if I remove the terminators on both everything seems
> to work as expected.
>
> According to the spec sheet for the 481, the DO pin should be high when
> the "inputs are open"? I have a feeling it has to do with the very short
> RS485 run with just two nodes on it and the involved resistances, but
> hopefully someone else has more experience and can give me a pointer.
>
> Thanks,
>
> -james
>
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here 
> <http://us.ard.yahoo.com/SIG=129mshora/M=295196.4901138.6071305.3001176/D=groups/S=1706554205:HM/EXP=1096745048/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com> 
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/AVR-Chat/
>     * To unsubscribe from this group, send an email to:
>       AVR-Chat-unsubscribe@yahoogroups.com
>       <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-01 by John Samperi

At 04:54 PM 1/10/04 -0400, you wrote:
>Thanks for the reply. Right now I am stuck with 481 on the board, but it 
>seems like it will meet my requirements. I've been reading some more 
>about this throughout the day and it seems that having to bias the bus 
>(using a pullup and pulldown) configuration is quite commonly done.
>

I use 2x560R to bias the line, one to the Vcc and one to ground.
(A+ goes to Vcc and B- goes to ground, just one of this biasing network
is required). Also a 120R in parallel with the comms line at the beginning 
of the line and one at the end of the line. With this set up an lowish baud 
rates you can go up to 1.2Km (4000ft). National Semiconductors has/had
some good info on "10 ways to bullet proof RS485" or something like it.


Regards

John Samperi

******************************************************
                        Ampertronics Pty. Ltd.
  11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
         Tel. (02) 9674-6495       Fax (02) 9674-8745
               Email: samperi@ampertronics.com.au
                 Website  http://www.ampertronics.com.au
* Electronic Design   * Custom Products   * Contract Assembly
******************************************************

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-02 by Brian Dean

Hi James,

On Fri, Oct 01, 2004 at 04:54:37PM -0400, James Russo wrote:

> Thanks for the reply. Right now I am stuck with 481 on the board, but it 
> seems like it will meet my requirements.

Just to clarify - the MAVRIC-II that you have uses the MAX487
transceiver, even though the silkscreen says MAX481 (they are pin
compatible).  As the MAXIM datasheets says about the MAX487:

  "The MAX487 feature reduced slew-rate drivers that minimize EMI and
  reduce reflections caused by improperly terminated cables, thus
  allowing error-free data transmissions up to 250 kbps."

I have run them at double that speed without problems, though over
short distances.  And the chip seems pretty tolerant regarding
termination.  Note that for short RS485 runs using these chips, I've
found that the terminator is generally unnecessary.

> I've been reading some more 
> about this throughout the day and it seems that having to bias the bus 
> (using a pullup and pulldown) configuration is quite commonly done.

The datasheet also states:

  "The receiver input has a fail-safe feature that guarantees a
  logic-high output if the input is open circuit."

Thus, when no driver is driving the bus, the state should not
fluctuate.  Even so, supplying the pull-up / pull-down resistors on
the A/B lines might be a good idea and is pretty common in RS485
implementations, especially since you might not be able to guarantee
that every transceiver on the bus has this feature.

-Brian
-- 
Brian Dean
BDMICRO - ATmega128 Based MAVRIC Controllers
http://www.bdmicro.com/

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-02 by James Russo

>   Note that for short RS485 runs using these chips, I've
> found that the terminator is generally unnecessary.

My situation is that with the terminators on, it doesn't keep the RO 
high. With them off it does. I have put pull-up/pull-down resistors and 
activated the terminators and all seems well.

Seems like according to the datasheet this wouldn't be necessary. Page 
10 of the data sheet (the table on the right) shows that the RO should 
be "1" when the inputs are open. What would be the electrical definition 
of "inputs open" be?

> Thus, when no driver is driving the bus, the state should not
> fluctuate.  

Fluctuating would be worse then saying logic low (start bit) with no 
xmiter. I am not seeing that, I am only seeing after turning off the 
driver on one node, the other node is recieving a 0.

> Even so, supplying the pull-up / pull-down resistors on
> the A/B lines might be a good idea and is pretty common in RS485
> implementations, especially since you might not be able to guarantee
> that every transceiver on the bus has this feature.

So, I would think that using these two boards together, I shouldn't need 
the pullup/down since it has this "fail-safe" feature. It's kind of a 
non-issue for now since I will just use the pull-up/pull down, but would 
just like to know why chip isn't working as advertised, even if only for 
my own enlightment.

take care,

-jr

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-05 by Brian Dean

On Sat, Oct 02, 2004 at 01:03:48AM -0400, James Russo wrote:

> My situation is that with the terminators on, it doesn't keep the RO
> high. With them off it does. I have put pull-up/pull-down resistors
> and activated the terminators and all seems well.

This makes sense, actually.  The terminator tends to pull the A & B
lines together, with regard to their potential difference, and RS485
sensitivity is usally around 200mV difference between A & B.  Thus,
with the terminator off, that would be an open circuit, and to the
MAX487, that is a known state.  Howver, with the terminator on, but no
balancing resistors to help seperate A & B in the case of no active
transmitter, that would put the line in an unknown state, i.e., < 200
mV between A & B.

> Seems like according to the datasheet this wouldn't be necessary. Page
> 10 of the data sheet (the table on the right) shows that the RO should
> be "1" when the inputs are open. What would be the electrical definition
> of "inputs open" be?

I believe that would be with no terminator, or the transceiver
completely disconnected from the bus.

Note that for short runs, the terminator is probably not necessary.
For longer runs, you should be careful about the ground connections,
as well as using a twisted pair, and the balancing resistors.  In
general, the longer the run, the more care you need to take wiring the
bus.

> So, I would think that using these two boards together, I shouldn't
> need the pullup/down since it has this "fail-safe" feature. It's
> kind of a non-issue for now since I will just use the pull-up/pull
> down, but would just like to know why chip isn't working as
> advertised, even if only for my own enlightment.

I think the only time the pull-up/pull-down resistors aren't necessary
is when there is no terminator, and you might do that for short cable
lengths.  And even so, if your software is tolerant of a missing byte
or two at the beginning or end of a transmission, i.e., using a packet
protocol with a few bytes of leadin (like ROBIN - see
http://www.bdmicro.com/code/robin), you might not even notice these
"glitches".

-Brian
-- 
Brian Dean
BDMICRO - ATmega128 Based MAVRIC Controllers
http://www.bdmicro.com/

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-05 by James Russo

Brian,

    Thanks for your explanation. It makes sense. I am going to go with 
the terminating resistors and some pull up/down resistors. I've been 
using it like this for the last 3 days or so and it seems to be working 
well.

Take care,

-jr

Brian Dean wrote:
Show quoted textHide quoted text
> On Sat, Oct 02, 2004 at 01:03:48AM -0400, James Russo wrote:
>
> > My situation is that with the terminators on, it doesn't keep the RO
> > high. With them off it does. I have put pull-up/pull-down resistors
> > and activated the terminators and all seems well.
>
> This makes sense, actually.  The terminator tends to pull the A & B
> lines together, with regard to their potential difference, and RS485
> sensitivity is usally around 200mV difference between A & B.  Thus,
> with the terminator off, that would be an open circuit, and to the
> MAX487, that is a known state.  Howver, with the terminator on, but no
> balancing resistors to help seperate A & B in the case of no active
> transmitter, that would put the line in an unknown state, i.e., < 200
> mV between A & B.
>
> > Seems like according to the datasheet this wouldn't be necessary. Page
> > 10 of the data sheet (the table on the right) shows that the RO should
> > be "1" when the inputs are open. What would be the electrical definition
> > of "inputs open" be?
>
> I believe that would be with no terminator, or the transceiver
> completely disconnected from the bus.
>
> Note that for short runs, the terminator is probably not necessary.
> For longer runs, you should be careful about the ground connections,
> as well as using a twisted pair, and the balancing resistors.  In
> general, the longer the run, the more care you need to take wiring the
> bus.
>
> > So, I would think that using these two boards together, I shouldn't
> > need the pullup/down since it has this "fail-safe" feature. It's
> > kind of a non-issue for now since I will just use the pull-up/pull
> > down, but would just like to know why chip isn't working as
> > advertised, even if only for my own enlightment.
>
> I think the only time the pull-up/pull-down resistors aren't necessary
> is when there is no terminator, and you might do that for short cable
> lengths.  And even so, if your software is tolerant of a missing byte
> or two at the beginning or end of a transmission, i.e., using a packet
> protocol with a few bytes of leadin (like ROBIN - see
> http://www.bdmicro.com/code/robin), 
> <http://www.bdmicro.com/code/robin%29,> you might not even notice these
> "glitches".
>
> -Brian
> -- 
> Brian Dean
> BDMICRO - ATmega128 Based MAVRIC Controllers
> http://www.bdmicro.com/
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here 
> <http://us.ard.yahoo.com/SIG=12977n8uf/M=294855.5468653.6549235.3001176/D=groups/S=1706554205:HM/EXP=1097032295/A=2376776/R=0/SIG=11ldm1jvc/*http://promotions.yahoo.com/ydomains2004/index.html> 
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/AVR-Chat/
>        
>     * To unsubscribe from this group, send an email to:
>       AVR-Chat-unsubscribe@yahoogroups.com
>       <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-05 by John Samperi

At 11:09 PM 4/10/04 -0400, you wrote:
>protocol with a few bytes of leadin (like ROBIN - see
>http://www.bdmicro.com/code/robin), you might not even notice these
>"glitches".

Very interesting, but the following doesn't make any sense:

0x01 - invalid parameter or command not possible. This would be 
the response if one commanded a node to run at 115200 baud, 
but the node could not actually run that fast. 

How would the node respond if it cannot communicate with the
master? :-)

I use a similar "home brewed protocol" for our equipment, but without
the flags field. The maximum data lenght is 255 bytes but I'm considering
a long packets mode (2 bytes len) because some of our electronic signs
need up to 450 chars. Perhaps I should include the flags field also.
I use 16 bit CRC which is supposed to give bit error check for up to 8Kb
packets. By the way it is not very difficult to use 9 bit mode with your PC,
there is a thread on the subject on Avrfreaks.net. I thought for a long
time that it would be hard without knowing that this facility has been
available with the PC UART for about 20 years, just using a different name.
I'm currently working on a Delphi interface to our products using the 9 bit
data protocol and it works like a charm.

Regards

John Samperi

******************************************************
                        Ampertronics Pty. Ltd.
  11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
         Tel. (02) 9674-6495       Fax (02) 9674-8745
               Email: samperi@ampertronics.com.au
                 Website  http://www.ampertronics.com.au
* Electronic Design   * Custom Products   * Contract Assembly
******************************************************

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-05 by Brian Dean

On Tue, Oct 05, 2004 at 05:42:54PM +1000, John Samperi wrote:

> 0x01 - invalid parameter or command not possible. This would be
> the response if one commanded a node to run at 115200 baud,
> but the node could not actually run that fast.
> 
> How would the node respond if it cannot communicate with the
> master? :-)

Specifically for configuration purposes, a jumper, switch, etc, should
be provided on the device to enter "configuration mode".  In
configuration mode, the line settings are preset to a known value.
Then the device can be configured using the described configuration
commands.  Upon reset, the new settings take effect.  At that time,
all nodes need to switch to the new settings, or they won't be able to
talk on the bus.

I think that what you are thinking in the example given above is that
the one node is running at 115200 and asking the other node to change
it's baud rate to match.  That's not the case - assuming configuration
mode is in effect (see the description of "Communications
Configuration" a little further down in the document), the line
settings are pre-arranged to known values.  After reset, the newly
commanded settings are then assumed.

> I use a similar "home brewed protocol" for our equipment, but
> without the flags field. The maximum data lenght is 255 bytes but
> I'm considering a long packets mode (2 bytes len) because some of
> our electronic signs need up to 450 chars.

We kept the data size in ROBIN fairly small because it's intended for
small microcontrollers where there is usually limited memory, and it
might be impossible to buffer large packets.  In practice, I haven't
found the 64 byte packet size of ROBIN too constraining.

> By the way it is not very difficult to use 9 bit mode with your PC,
> there is a thread on the subject on Avrfreaks.net. I thought for a
> long time that it would be hard without knowing that this facility
> has been available with the PC UART for about 20 years, just using a
> different name.  I'm currently working on a Delphi interface to our
> products using the 9 bit data protocol and it works like a charm.

Do you have a link to the thread - I'd be interested in that.

Thanks!
-Brian
-- 
Brian Dean
BDMICRO - ATmega128 Based MAVRIC Controllers
http://www.bdmicro.com/

Re: [AVR-Chat] RS485 w/ MAX481, terminators not needed?

2004-10-06 by John Samperi

Thanks for the clarification.

At 07:29 PM 5/10/04 -0400, you wrote:
>
>Do you have a link to the thread - I'd be interested in that.

Just got to the Avfreaks.com site and the first forum.
Then do a seach for RS485 in the last 30 days and it
should come up. (I made some silly comments on the
thread not knowing better :-(( )

Basically the 8250 and descendeds 16450 etc have 5 different
parity modes that can be used , NONE, EVEN,ODD these
are the usual but then there is the MARK and SPACE mode
which are basically the 9 bit mode with MARK setting the parity
bit (i.e. the Address mode) and the SPACE clearing it (Data mode).
By just toggling these 3 modes your everyday PC UART can talk
to a 9 bit mode micro. If anyone is interested I can post the Delphi code
I have been using for the past week or so. It's not bullet proof yet but
it works very well.

You can also have a look at the 16550 etc data sheet under parity.



Regards

John Samperi

******************************************************
                        Ampertronics Pty. Ltd.
  11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
         Tel. (02) 9674-6495       Fax (02) 9674-8745
               Email: samperi@ampertronics.com.au
                 Website  http://www.ampertronics.com.au
* Electronic Design   * Custom Products   * Contract Assembly
******************************************************

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.