Skip to main content

Reply to "Using an optocoupler to connect insulated rail to input pin of shift register"

Leo, I had so many problems with RS485 that I can't keep track of them all ;-)  I used an oscilloscope to watch the quality of the signal, which was *extremely* helpful when evaluating different wire types, bias resistors, and termination resistors.

One thing is that I am using Maxim MAX485 chips, which are not traditional RS485 in the sense that they operate on 5vdc.  I started using the "RS485 Modules" available on eBay for $1/each, which include SMT resistors and capacitors in addition to a MAX485 chip -- and they worked perfectly on my workbench but then would not work when connected to my "real" network -- which consists of 7 modules and a total bus length of only about 10 feet.  Adding that many modules changed the total amount of resistance for the bias resistors, which might have been part of the problem (all of those resistors in parallel reduced the total resistance each time a new module was added.)

In the end, what finally worked for me is the following: I built my own boards (on small breadboards), including a 0.1uf ceramic non-polarized capacitor across the power pins of every chip, and made the bus with shielded twisted-pair wire, and monkeyed with bias and termination resistors until I had the cleanest signal on my oscilloscope.  I think what made the most difference is adding the 0.1uf capacitors -- once I did that, everything started working with 100% reliability.

I wrote my own message protocol which includes a CRC error check and if even one bit is not communicated correctly, my whole system does an immediate emergency stop (like pressing the emergency stop button on your CAB-2 controller -- everything including track power is shut off.)  I also added Transmit and Receive LEDs to each of my boards - controlled by code and not connected to the chip - so I can see when each chip is transmitting or actively receiving a message.  Mostly for fun, but also helpful in debugging.

I bought individual MAX485 chips from both a reputable U.S. supplier (expensive), as well as on eBay for about $1/each -- and in testing, could not find any differences in signal quality.  So the cheap ones on eBay are fine.  Just don't buy the ready-made "RS485 Modules" unless you are only hooking a couple together in close proximity.

I hope that helps!

Randy

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×