RS485 questions - Page 1
Forum section: electronics / beginners

author: FrankT
author_rank: Regular Contributor
timestamp: May 05, 2013, 10:37:20 pm
content: 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

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 05, 2013, 11:14:23 pm
content: Quote from: FrankT on May 05, 2013, 10:37:20 pmThe 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.QuoteIt 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.QuoteThere are zillions of RS485 chips with various permutations of load, supply voltage, protection etc. Also some isolated solutionsQuote250kbits 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.QuoteYes. 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.QuoteAgain, look ta the data on a scope - this will usually tell you what's happenningQuoteDepends 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.Quoteclean 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.

author: digsys
author_rank: Unknown
timestamp: May 05, 2013, 11:42:02 pm
content: Quote from: FrankTAbsolutely nothing wrong with mixed voltages, it's very common now. There are plenty of Transceivers for these situations.Quote from: FrankTNot 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: FrankTAbsolutely FINE. You can go from DC to the max speed. It's not like TCP for example, with a narrow Freq range.Quote from: FrankTI'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 allsorts of mixed combinations work perfectly fine. Even though it's supposed to be a NON-0V referenced system, sometimes I've hadto use opto isolation on "bad" nodes, but they were over KMs away, in different buildings.Quote from: FrankTVERY 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: FrankTIF 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: FrankTDepending on the number of nodes, it should be pretty close. On a slightly messy star network, I use ~330-500R at each branch, toget 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 extra2 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/0Vby 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.

author: gxti
author_rank: Frequent Contributor
timestamp: May 06, 2013, 01:05:28 am
content: 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.

author: David_AVD
author_rank: Super Contributor
timestamp: May 06, 2013, 03:00:56 am
content: 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.

author: digsys
author_rank: Unknown
timestamp: May 06, 2013, 03:53:15 am
content: Quote from: David_AVD on May 06, 2013, 03:00:56 amThat'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.

author: gxti
author_rank: Frequent Contributor
timestamp: May 07, 2013, 12:09:10 am
content: 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...

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 07, 2013, 12:26:16 am
content: 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. .

author: gxti
author_rank: Frequent Contributor
timestamp: May 07, 2013, 12:45:35 am
content: 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.

author: digsys
author_rank: Unknown
timestamp: May 07, 2013, 04:31:24 am
content: Quote from: gxtiI 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 PowerSupply 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 etcThese bastids HAVE to be tough, I think there's even rules / standards set.

author: David_AVD
author_rank: Super Contributor
timestamp: May 07, 2013, 05:19:11 am
content: 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.

author: FrankT
author_rank: Regular Contributor
timestamp: May 07, 2013, 07:44:20 am
content: 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

author: digsys
author_rank: Unknown
timestamp: May 07, 2013, 08:45:57 am
content: Quote from: FrankTGreat news. Nice to see it was something silly :-) .... as we've said - RS485 is quite bullet-proof.

author: peter.mitchell
author_rank: Super Contributor
timestamp: May 07, 2013, 12:41:49 pm
content: 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.