Author Topic: RS485 Driver questions  (Read 11320 times)

halloween_man

  • Member
  • ***
  • Posts: 1
RS485 Driver questions
« on: March 08, 2011, 09:34:13 pm »
Hi,

I have several questions regarding RS485 and hope you can shed some light.  Your article regarding RS485 from 1999 was great, I learned a great deal from it.

First question:

I have read the RS485 is good for small packets being sent.  "Small" is a relative term and I was wondering what is small?  In my application I will be sending 8 bytes from the Master to the Slaves.  The Slaves will respond with a 2 byte packet.

Is my 8 byte/2 byte protocol considered "Small"?


Second question:

I have read that termination may not be required depending on network length.  In my application my shorted network will be 12 inches long with a single slave, while some will be upwards of 1000 feet long and could have 20 slaves.  From your article it appears that I do not need terminators for runs that are this short.  I would like to simplify my PCB design for the above and everything in between. 

Is it bad to have terminators for a network that is this short and are both terminators required?


Third question:

I will be using PIC18F and dsPIC33 processors.  I will be trying to come up with a baud rate both can do with as little RS232 %error as possible.  I want to try to be in the 140Kbps range which is a non standard baud rate.

Does the driver care what the actual baud rate is, even if it is non-standard (I am using MAX3085EEPA+ and MAX3075EEPA+)?


Forth question:

Continuation of #3 above.  My Master and Slaves will have an RS232 % error of less than .7% each (say +.69% for one and -.28% for the other).  I know straight RS232 a low % error works fine between 2 PICs from the same family works fine.

Will the Master and Slaves be able to communicate with each other with RS232 % errors via RS485 drivers?


Fifth question:

I have seen many circuits on the web in which the RE/DE pins are tied together and have a Pull Up resistor OR Pull Down resistor tied to them.

Is one way better than the other, why would they do this and is it necessary?


Sixth question:

I will be using RJ45 connectors on my PCB to allow quick connect/disconnect.  The cable had 4 twisted pairs in it.  I will use one twisted pair for communication.  I will use a second pair tied together at each end for the common ground and use the 100 ohm resistor you mentioned in your article.  I cannot afford the MAX1480 IC and it will not fit in the area available on my current PCB layout.

Do I have to concern myself with, and if so, how do I prevent ground loops?


Seventh question:

On some designs I have seen 56 ohm resistors placed in series with the RS485 output side.  One resistor in series with B and one in series with A.

Why would this be necessary?



Based on what I learned from your article I have chosen to use the MAX3085EEPA+ for 5V microprocessors (PIC18F) and MAX3075EEPA+ for 3.3V micro processors (dsPIC33).


I have more questions but do not have them in front of me.  I think this is a very good start though.

Thank you for your time and effort.....

Ron





Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: RS485 Driver questions
« Reply #1 on: March 09, 2011, 09:49:12 am »
I'll start with the first four...

I have read the RS485 is good for small packets being sent.  "Small" is a relative term and I was wondering what is small?  In my application I will be sending 8 bytes from the Master to the Slaves.  The Slaves will respond with a 2 byte packet.

Is my 8 byte/2 byte protocol considered "Small"?

yes

Second question:

I have read that termination may not be required depending on network length.  In my application my shorted network will be 12 inches long with a single slave, while some will be upwards of 1000 feet long and could have 20 slaves.  From your article it appears that I do not need terminators for runs that are this short.  I would like to simplify my PCB design for the above and everything in between.  

Is it bad to have terminators for a network that is this short and are both terminators required?

Terminations do no harm except some extra power consumption.  If you use terminations, you need one at each end.

Third question:

I will be using PIC18F and dsPIC33 processors.  I will be trying to come up with a baud rate both can do with as little RS232 %error as possible.  I want to try to be in the 140Kbps range which is a non standard baud rate.

Does the driver care what the actual baud rate is, even if it is non-standard (I am using MAX3085EEPA+ and MAX3075EEPA+)?

The hardware doesn't care.

Forth question:

Continuation of #3 above.  My Master and Slaves will have an RS232 % error of less than .7% each (say +.69% for one and -.28% for the other).  I know straight RS232 a low % error works fine between 2 PICs from the same family works fine.

Will the Master and Slaves be able to communicate with each other with RS232 % errors via RS485 drivers?

Both use the same UART so likely no difference at the same baud rate.

I will also point out that if you liked my article from 1999, you will also find my Serial Port Complete book useful. It answers questions like these and more.

Jan
« Last Edit: March 09, 2011, 09:51:48 am by Jan Axelson »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: RS485 Driver questions
« Reply #2 on: March 10, 2011, 12:11:43 pm »
Fifth question:

I have seen many circuits on the web in which the RE/DE pins are tied together and have a Pull Up resistor OR Pull Down resistor tied to them.

Is one way better than the other, why would they do this and is it necessary?

Leave the receiver enabled if you want to receive the data you send. Otherwise disable it when sending.


Sixth question:

I will be using RJ45 connectors on my PCB to allow quick connect/disconnect.  The cable had 4 twisted pairs in it.  I will use one twisted pair for communication.  I will use a second pair tied together at each end for the common ground and use the 100 ohm resistor you mentioned in your article.  I cannot afford the MAX1480 IC and it will not fit in the area available on my current PCB layout.

Do I have to concern myself with, and if so, how do I prevent ground loops?

Your setup sounds OK.


Seventh question:

On some designs I have seen 56 ohm resistors placed in series with the RS485 output side.  One resistor in series with B and one in series with A.

Why would this be necessary?

Do a search on serial terminations

Jan