Shop OBEX P1 Docs P2 Docs Learn Events
Passing RS485 bus data between two XBee — Parallax Forums

Passing RS485 bus data between two XBee

KCmax485KCmax485 Posts: 2
edited 2015-02-25 17:46 in Accessories
Hi,
I am a model railroader.My train control system uses a RS485 bus to communicate between throttles and the command station.The throttle is used to control
locomotive speed,direction and functions like headlight,bell and horn.The throttle is connected to the RS485 bus using din sockets on the layout and a din plug
on the throttle's wiring harness.
I would like to use two 802.15.4 XBee Series 1 modules to basically stand in for the "A" and "B" wires of the throttle's harness making the throttle wireless.
Here is a link to information regarding the RS485 bus.In the third paragraph there is a link (the word "published" in blue text) that leads to more detailed information.

http://lenzusa.com/1newsite1/XpressnetFAQ.html

My question is can this be done and if so,exactly how do I connect one XBee to the RS485 bus and the other XBee to the throttle.Could it be as simple as
connecting the "A" and "B" to the XBee Tx Data Out and RX Data In.Will it require other components like a MAX 485 chip?

I am guessing that more information will be needed to answer my question.Tell me what it is and I will try to provide it.

Thanks,
Kip

Comments

  • JonnyMacJonnyMac Posts: 9,102
    edited 2015-02-10 21:47
    If you're wanting to go from XBee to RS-485 on the other side that might be a trick; the RS-485 transceiver requires a transmit enable signal before sending, and that must be removed for receiving. I suppose you toss a small micro in as a bridge between the XBee and RS-485, but there may be a way to setup the XBee to assert the TX enable signal automatically.

    A few minutes later....

    Found this thread in the Digi forum -- you should have a look.
    -- http://www.digi.com/support/forum/5737/xbee-rs485-adapter-802-15-4-pro
  • max72max72 Posts: 1,155
    edited 2015-02-12 03:24
    wouldn't MAX3071 and Xbee in transparent mode work?

    Massimo
  • JonnyMacJonnyMac Posts: 9,102
    edited 2015-02-12 09:16
    The system he wants to connect to uses 2-wire (half-duplex) RS-485; this configuration requires a TX Enable signal.
  • max72max72 Posts: 1,155
    edited 2015-02-12 13:05
    Thanks.
    Missed the point.
    Massimo
  • SCASSCAS Posts: 3
    edited 2015-02-23 18:40
    JonnyMac wrote: »
    The system he wants to connect to uses 2-wire (half-duplex) RS-485; this configuration requires a TX Enable signal.

    Very doable if you know how to program. I do it all the time. You don't even need to do A & B. JUst invert the A to B on the receiving side of the line to the proper voltage. The TX enable over a wire or over the air is the same thing. The line is still being held down for the slaves to see. You would of course need a microprocessor on both sides. Not a whole lot of data transfer is taking place thou.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-24 07:54
    SCAS wrote: »
    Very doable if you know how to program. I do it all the time. You don't even need to do A & B. JUst invert the A to B on the receiving side of the line to the proper voltage. The TX enable over a wire or over the air is the same thing. The line is still being held down for the slaves to see. You would of course need a microprocessor on both sides. Not a whole lot of data transfer is taking place thou.

    What do you do all the time? As far as I know, a XBee has one transmit line. What's being used to control the enable line?
  • SCASSCAS Posts: 3
    edited 2015-02-25 17:46
    In 485 half duplex systems, the master controls the bus. So the buss extends thru both the sending and the receiving xbee. The output of the receiving xbee is the beginning of the wired buss. Use a single pin such as DIO1 to hold down the buss on all slaves. Use the 2 PWM outputs to send data and the UART input to receive data. Control is established by DIO1 holding down the output lines and controlling the logic gates on the PWM and UART pins for direction control. This can also be done in software if you wish. Then a 485 chip is not even needed at all.
Sign In or Register to comment.