Author Topic: RS485 questions  (Read 5354 times)

0 Members and 1 Guest are viewing this topic.

Offline FrankTTopic starter

  • Regular Contributor
  • *
  • Posts: 176
  • Country: au
RS485 questions
« on: May 05, 2013, 10:37:20 pm »
I have a few rs485 questions.  I have accidentally installed a 5v transceiver in a 3.6v circuit so I'm looking a little closer at the datasheets this time.

I'll probably use a SN65HVD12D (http://www.ti.com/lit/ds/symlink/sn75hvd12.pdf), but I've only selected that because I'm planning to run up to 1Mbps (short links to robot modules).

Questions
- What is "Unit Loads"  this chip is specified as "1/8"?
- The part specifies a signalling rate of 1Mbps (there are others for 10Mbps and 32Mbps).  Is the only speed it will work at, or will it work up to the specified rate?  What happens if I use the 32Mbps chip at 1Mbps?
- Is there anything else I should be looking at.

And some general rs485 questions...
- I'm running a 5v transceiver at 250kbs at 3.6v, sending 10 short messages per second, and I'm getting crc receive errors in about 1 in 10 messages (20cm link).  Is this mostly likely due to running the chip undervoltage?
- I'm only using 2 wires (D+,D-) at the moment.  Do I need to ground all the modules on the rs485 bus too?  I tried this, but it seemed to increase the error rate.
- Termination resistors - From what I've read, I need to put 2 x 120ohm resistors across D+,D-.  These should be placed at either end of the rs485 chain.  How important is the value of the resistors, and their placement?  Is there a way to check my chain is "good"?  What does an oscilloscope show when the chain is good and bad?

Thanks,
Frank
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13740
  • Country: gb
    • Mike's Electric Stuff
Re: RS485 questions
« Reply #1 on: May 05, 2013, 11:14:23 pm »
I have a few rs485 questions.  I have accidentally installed a 5v transceiver in a 3.6v circuit so I'm looking a little closer at the datasheets this time.

I'll probably use a SN65HVD12D (http://www.ti.com/lit/ds/symlink/sn75hvd12.pdf), but I've only selected that because I'm planning to run up to 1Mbps (short links to robot modules).

Questions
- What is "Unit Loads"  this chip is specified as "1/8"?
The RS485 standard specifies the load a transciver may place on the bus, and a limit of (I think) 32 devices - but this chip will present 1/8 of that, allowing 256 devices.
Quote
- The part specifies a signalling rate of 1Mbps (there are others for 10Mbps and 32Mbps).  Is the only speed it will work at, or will it work up to the specified rate?  What happens if I use the 32Mbps chip at 1Mbps?
It will work up to that - the reason for slower chips is lower slew rate to reduce noise, power draw, crosstalk and reflection issues in non-optimally terminated systems (stubs etc.). You can use them all down to  DC if you want.
Quote
- Is there anything else I should be looking at.
There are zillions of RS485 chips with various permutations of load, supply voltage, protection etc. Also some isolated solutions
Quote
And some general rs485 questions...
- I'm running a 5v transceiver at 250kbs at 3.6v, sending 10 short messages per second, and I'm getting crc receive errors in about 1 in 10 messages (20cm link).  Is this mostly likely due to running the chip undervoltage?
250kbits over cat5 is good for well over 100 metres. Sounds like you have some other issues - what does it look like on  the scope?
line biasing can be a good idea to ensure it goes cleanly to & from a well-defined idle state.
Quote

- I'm only using 2 wires (D+,D-) at the moment.  Do I need to ground all the modules on the rs485 bus too?
Yes. Although it's differential, it has limited common-mode range, so you can get all sorts of issues if you don't either ground or use an isolated interface. Even an isolated interface should include ground on the bus side of the isolator maximise noise rejection.
If your devices don't share a common power supply, and are not isolated some other way, then isolated links are highly reccommended. I like the AD ADM2482E, which includes a driver for the DC/DC converter transformer. Linear do some integrated isolated transceivers (but expensive). NVE also make a range of digital isolators. Avoid optocouplers for all but low data rates.
NVE do make some passive input isolators that can be used with no ground reference, but loading is quite high. 
Quote
I tried this, but it seemed to increase the error rate.
Again, look ta the data on a scope - this will usually tell you what's happenning
Quote
- Termination resistors - From what I've read, I need to put 2 x 120ohm resistors across D+,D-.  These should be placed at either end of the rs485 chain.  How important is the value of the resistors, and their placement? 
Depends on the cable length and data rate. You should generally use termination as it will mostly help rather than hinder, but in some cases termination can make things worse, especially using cat5 due to the cable resistance. For runs of a few tens of metres below a megabit or so, termination is unlikely to make a difference.
Quote

Is there a way to check my chain is "good"?  What does an oscilloscope show when the chain is good and bad?

clean data edges, not too much overshoot, D+ and D- being the inverse of each other.

RS485 is a very robust system, however a major cause of problems in the field  is that of one of the data lines goes open , it can 'sometimes' work, and give strange errors - a bad connection may be initially missed, but only show symptoms some time later, e.g. when other devices are connected  On any RS485 installation, a simple cable continuity test is essential - if terminated, simply checking for  termination at the far end is a quick and easy check that should be done before any other faultfinding. 

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: RS485 questions
« Reply #2 on: May 05, 2013, 11:42:02 pm »
Quote from: FrankT
I have a few rs485 questions.  I have accidentally installed a 5v transceiver in a 3.6v circuit ...
Absolutely nothing wrong with mixed voltages, it's very common now. There are plenty of Transceivers for these situations.
Quote from: FrankT
Questions - What is "Unit Loads"  this chip is specified as "1/8"? 
Not totally sure of unit load, but they say you can have 256 nodes, which is quite high. Since it says "optional", I wouldn't worry about it.
Maybe it's a de-rating at 32MB speeds.
Quote from: FrankT
- The part specifies a signalling rate of 1Mbps (there are others for 10Mbps and 32Mbps).  Is the only speed it will work at, or will it work up to the specified rate?  What happens if I use the 32Mbps chip at 1Mbps?   
Absolutely FINE. You can go from DC to the max speed. It's not like TCP for example, with a narrow Freq range.
Quote from: FrankT
- Is there anything else I should be looking at. 
I've made 1,000s of RS485 driver / converter sets. It's pretty damn well bullet-proof. Leave provision for 3x Terminating resistors.
D+ to Supply, D- to Gnd, and D+ to D- . Depending on your network topography, you may need to Terminate the end-of-lines.
RS485 ideally likes a daisy-chain network, with terminations each end. Star network is the "hardest" to get perfect. BUT, I've had all
sorts of mixed combinations work perfectly fine. Even though it's supposed to be a NON-0V referenced system, sometimes I've had
to use opto isolation on "bad" nodes, but they were over KMs away, in different buildings.
Quote from: FrankT
And some general rs485 questions...
- I'm running a 5v transceiver at 250kbs at 3.6v, sending 10 short messages per second, and I'm getting crc receive errors in about 1 in 10 messages (20cm link).  Is this mostly likely due to running the chip undervoltage?   
VERY unlikely, as I said, the drivers are designed for multi-voltage. The specs say 6V max Vcc. More likely your termination resistors,
or topography. Is it just 1-1 for now? Otherwise, if you don't need the speed, there are other chipsets with more flexible Voltage ranges.
Quote from: FrankT
- I'm only using 2 wires (D+,D-) at the moment.  Do I need to ground all the modules on the rs485 bus too?  I tried this, but it seemed to increase the error rate.   
IF you mean "connect the 0Vs" - ie 3 wire : By the specs, you're not supposed to, BUT I always have and it's NEVER been a problem.
Your issue must be something else.
Quote from: FrankT
- Termination resistors - From what I've read, I need to put 2 x 120ohm resistors across D+,D-.  These should be placed at either end of the rs485 chain.  How important is the value of the resistors, and their placement?  Is there a way to check my chain is "good"?  What does an oscilloscope show when the chain is good and bad?   
Depending on the number of nodes, it should be pretty close. On a slightly messy star network, I use ~330-500R at each branch, to
get it close to 120R. The lower the data-rate, the more you can get away with, but 120-150R should be the final range. Try the extra
2 resistors to Supply/0V. I use from 1K-2K2. Terminations should be reasonably close to the end nodes.
As far as CRO waveforms go - IF, you use 3x Resistor termination method, both signals should never be higher or lower than Vcc/0V
by 1V (it's how they detect a short). So you'll see a 1-2V square wave, opposite polarity.
RS485 is quite easy to use, so your problem shouldn't be hard to solve.
Hello <tap> <tap> .. is this thing on?
 

Offline gxti

  • Frequent Contributor
  • **
  • Posts: 507
  • Country: us
Re: RS485 questions
« Reply #3 on: May 06, 2013, 01:05:28 am »
There are certainly transceivers that will run on lower IO voltages but I doubt that taking a "5V only" chip and feeding it 3V will produce satisfactory results. It needs the 5V to drive the actual transceiver and without it it might not behave correctly. Mixed-voltage transceivers have separate power inputs for 5V and IO voltage, or some other provision for getting 5V to drive the output.
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: RS485 questions
« Reply #4 on: May 06, 2013, 03:00:56 am »
Does RS485 have to be 0-5V ?  My understanding is that you just need to end up with a 200mV min differential (within the allowed common mode range of course) to detect the correct state.
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: RS485 questions
« Reply #5 on: May 06, 2013, 03:53:15 am »
Does RS485 have to be 0-5V ?  My understanding is that you just need to end up with a 200mV min differential (within the allowed common mode range of course) to detect the correct state.
That's right, supply voltage can vary. The "fault" conditions are too close to 0V or VCC (withing 500mV or so, check IC specs),
min V-Diff (as you said) and matching Inverse levels (You can get away with tying say D- to 1.0V and running it single wire mode),
I've done it many times and all you lose is that 1 level of error.
Hello <tap> <tap> .. is this thing on?
 

Offline gxti

  • Frequent Contributor
  • **
  • Posts: 507
  • Country: us
Re: RS485 questions
« Reply #6 on: May 07, 2013, 12:09:10 am »
Fair enough, but that doesn't mean a specific IC that requires 5V to operate will operate on 3.3V. OP never said what chip he was using though so who knows...
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13740
  • Country: gb
    • Mike's Electric Stuff
Re: RS485 questions
« Reply #7 on: May 07, 2013, 12:26:16 am »
A 3v chip will probably not drive as long a cable as a 5V one, especially when terminated. It should make no difference if a receiver is 3v or 5v as either should be looking for a few hundred mV difference. .
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline gxti

  • Frequent Contributor
  • **
  • Posts: 507
  • Country: us
Re: RS485 questions
« Reply #8 on: May 07, 2013, 12:45:35 am »
Just to be perfectly clear, I'm (now) talking about meeting the minimum supply voltage requirements of the IC, nothing to do with RS485 specifically. For example, all of the cheapest transceiver ICs listed on Digi-Key require a nominal VCC of 4.75-5.25V or so. Sure it could interface with other 3V transceivers on the bus, but if you don't feed it the required voltage it may malfunction.

I was initially mistaken about the bus voltage itself, sorry for confusing the matter.
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: RS485 questions
« Reply #9 on: May 07, 2013, 04:31:24 am »
Quote from: gxti
... meeting the minimum supply voltage requirements of the IC ...
... all of the cheapest transceiver ICs listed on Digi-Key require a nominal VCC of 4.75-5.25V or so. Sure it could interface with other
3V transceivers on the bus, but if you don't feed it the required voltage it may malfunction. 
I haven't had a look lately, but ALL of the Transceivers I've used for the last several years are 3V3/5V compatible or tolerant, both Power
Supply and signal levels. Includes RS232, RS485, CAN, USB, Fiber etc and I've never had a problem finding an IC that is.
Plus, I don't think I've ever used one that can't handle unlimited short cct / O-Voltage/ static to 1-2KV etc etc
These bastids HAVE to be tough, I think there's even rules / standards set.
Hello <tap> <tap> .. is this thing on?
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: RS485 questions
« Reply #10 on: May 07, 2013, 05:19:11 am »
We use the MAX1483 a lot and it mentions Vcc as 4.75V - 5.25V in the pin descriptions.  The logic high and low levels are specified as 2.0V and 0.8V respectively so should work with 3.3V MCU outputs just fine.
 

Offline FrankTTopic starter

  • Regular Contributor
  • *
  • Posts: 176
  • Country: au
Re: RS485 questions
« Reply #11 on: May 07, 2013, 07:44:20 am »
I think I've finally fixed my rs485 issues...

- I replace the driver with one that works with a 3.6v power supply, but I don't think that made a difference (I didn't look at the scope trace before I replaced it).
- I had to add a pull up resistor to RX.  I have ~RE/DE connected together.  When transmitting, RX would float, causing garbage on the line.
- I had a bug in my interrupt comms routine which, every now and then, would turn off the transmitter before the last byte was sent - in AVR speak, a TXC occurred while inside the DRE ISR causing the TXC ISR to be called immediately after returning from the DRE ISR stopping transmission.

Thanks for all the replies.
Frank
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: RS485 questions
« Reply #12 on: May 07, 2013, 08:45:57 am »
Quote from: FrankT
  I think I've finally fixed my rs485 issues... 
Great news. Nice to see it was something silly :-) .... as we've said - RS485 is quite bullet-proof.
Hello <tap> <tap> .. is this thing on?
 

Offline peter.mitchell

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: au
Re: RS485 questions
« Reply #13 on: May 07, 2013, 12:41:49 pm »
RS-485 really is quite amazing, especially with low speeds, I once installed a 1150m RS-485 link in a mine, running on normal direct bury CAT5e.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf