Shop OBEX P1 Docs P2 Docs Learn Events
Prop-to-prop serial communication, what distances? — Parallax Forums

Prop-to-prop serial communication, what distances?

nohabnohab Posts: 96
edited 2008-11-15 19:33 in Propeller 1
Hi,

I would like to connect two Propellers with a two- or three-wire-cable using FullDuplexSerial or SimpleSerial.
In the case with two-wire-cable, one is ground and the other should be pull-ed up with an appriopriate resistor and one Propller at a time "speaking"
In the case with three-wire-cable, one is ground and the other two are directly connected to two Propleller pins.

What distances can be reasonable to communicate over?
Is there a difference in useable distance depending on which solution I choose? (and depending on size of pull-up resistor?)
Other parameters affecting the manageable distance?



·

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-11 16:49
    A better question would be, "I need to communicate over a distance of x feet. What do I need to do to get that distance?" So, how big is x?

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
  • trodosstrodoss Posts: 577
    edited 2008-11-11 16:56
    Hello,
    I know that the Hydra has a two-wire port using an RJ11 jack, with a simple crossover (RX/TX) that uses a 51 ohm resistor on the TX. OldBitCollector has a schematic of this in the Propeller Cookbook:

    http://ucontroller.com/Propeller Protoboard Designs for the Beginner.pdf

    If you are trying a one-wire communication with a ground, I know that there has been mention of that on the forum as well.

    I do not have the Hydra book with me at the moment, but believe that with the Hydra-Net port (mentioned above) that it is capable of hundreds of feet.· There is a cross-talk cancellation as part of the design which is used to keep the communication stable over increasing distance.

    [noparse][[/noparse]Edit:] Phil brings up a good point though about distance.·

    I haven't tried the Hydra-Net circuit, but have done IR communication with a ProtoBoard to a Lego Mindstorm's USB tower (trying to convince it that it is talking to an·RCX).

    Post Edited (trodoss) : 11/11/2008 5:11:26 PM GMT
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-11-11 17:07
    I am with Phil, how big is x?

    If the distance is large then you may need some sort of transceiver for sending and receiving the signals. This isn't complicated as in some cases you still use the serial object, but your TX/RX line are wired to a transceiver. The solution I am thinking about would be a RS-485 network style transceiver or RS-232 transceiver.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
    www.tdswieter.com
  • T ChapT Chap Posts: 4,223
    edited 2008-11-11 17:57
    Another option is fiber optics, using a single strand you can run hundreds of feet bidirectionally.
  • simonlsimonl Posts: 866
    edited 2008-11-11 20:56
    According to the CCITT V.24/V.28 (RS232) standard; I believe the maximum reliable distance is 50ft (15m), but I too agree with Phil - it depends on what you're trying to achieve. For instance; the RS232 standard assumes ideal conditions, so you certainly wouldn't get 50ft if the wiring is unshielded and is running close to electrically noisy equipment.

    CCITT said...
    The specification for RS-232 calls for a maximum distance of 50 feet at 20Kbps and the RS-422/485 specification calls for a maximum of 5000 feet at 9600Bps. Data rates are a function of the distance of the cable. The shorter the cable length the higher the data rate that can achieved.

    Don't forget (as I almost did!) that the standard is at +-15V too, so I expect that the distances will be substantially shorter at 0-3.3V wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif

    Post Edited (simonl) : 11/11/2008 9:13:11 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-11-11 21:31
    I have not tested the distances with FullDuplexSerial or SimpleSerial, but for the high speed Prop-to-Prop communication(NonStandard-RS232) program I wrote awhile back I was using 10 feet of 4-conductor flat ribbon cable.

    http://forums.parallax.com/showthread.php?p=691952

    ...PS - you can gain much more distance by going with slower communication speeds, and minimizing the transmission wire capacitance... <-- In this case you want shielding, but too much shielding can kill your signal at high speeds.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • OwenSOwenS Posts: 173
    edited 2008-11-12 16:15
    I'll join in reccomending that you use RS-485 (simplex) or RS-422 (duplex) communications. RS-485 takes 2 data wires, RS-422 takes 4. You connect them using good quality UTP and they'll run many meters. Connect them using good quality STP and they should run even further.
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-12 16:49
    My Fire Alarm system goes over 200' with no problems on a telephone cable at 9600 baud. They have ran for several months with no comm problems.

    http://forums.parallax.com/forums/default.aspx?f=21&m=280663
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-11-12 23:59
    Really? The Fire Alarm has been running for a couple months? Don't you think you should get that fixed?

    tongue.gif

    Sorry, I read your post Computer Geek 101 and it made me laugh. Maybe I am just in a quirky mood.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
    www.tdswieter.com
  • Mike HuseltonMike Huselton Posts: 746
    edited 2008-11-13 00:25
    Nice one, Tim.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional
  • nohabnohab Posts: 96
    edited 2008-11-13 14:26
    OK, I rephrase the question as suggested:
    I need to communicate over a distance of 50 feet. What do I need to do to get that distance?"
    The speed is not very important, 19200 is just fine (and bottom-limit is as low as 2400)
    Robustness, simplicity and low price is most important.
  • LeonLeon Posts: 7,620
    edited 2008-11-13 15:05
    RS-422 with shielded twisted pair wire?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-11-13 15:57
    There are several things that play a role here:
    Wire gauge will determine the amount of resistance loss over the wire as well as the wire inductance.
    The proximity between the wires will·determine capacitance as well as the wire inductance.
    Voltage over the wire can also play a role. Generally the lower the voltage the better, because it takes less time to transition on the signal edges. However at a lower voltages, depending on the length of the line, inductive and capacitive effects, a lower voltage can be more difficult to distinguish from noise.

    Higher frequencies will have a more difficult time than lower frequencies ... i.e. 2400 baud verses 19200 baud ... start low and work your way up.

    Ideally you want to go with a wire that's rated with the lowest capacitance per foot, but consider that this is usually at the cost of less shielding of the wire. Ask yourself "how susceptible is my environment to noise?"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • heaterheater Posts: 3,370
    edited 2008-11-13 16:14
    So what is/are the trick/s used with DSL technology to get high speeds over normal underground telephone cables. We're talking for example of 2Mbit per second up to 5 kilometres?

    Presumably it's balanced.

    Can the Prop implement anything close to this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-11-13 16:47
    They use a technique known as QAM (Quadrature Amplitude Modulation) that significantly reduces the bandwidth... Cable TV uses a similar
    scheme. http://en.wikipedia.org/wiki/Quadrature_amplitude_modulation
    "Can the Prop implement anything close to this?" - Sure... I started working on a variant·of·QAM,·replacing Amplitude with Phase differences same concept as QAM·... Right now I just don't have time to get my head around it to mess with it.
    ·



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2008-11-13 18:39
    Why don't you get a fifty foot coil of two-conductor shielded cable and try, to begin with, 2400 baud with the
    Full Duplex Serial routine. Try 2400, 4800, etc until it first begins to fail. Then drop the baud rate by a power of two, or half.
    The time you spend testing would be an hour or two. Then move on to the next programming issue.

    Phil Pilgrim recommended this approach at the beginning of the discussion. What do you want to spend your time on:
    Theorizing or solving the problem?

    This is my standard empirical approach to problem of this nature; it is a matter of philosophy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional

    Post Edited (Quantum) : 11/13/2008 6:50:52 PM GMT
  • SuperCricketSuperCricket Posts: 17
    edited 2008-11-13 19:53
    Computer Geek 101 said...
    My Fire Alarm system goes over 200' with no problems on a telephone cable at 9600 baud. They have ran for several months with no comm problems.

    What type of serial communication are you using? One of the already written serial objects for the Prop?

    If so, Nohab, there is your answer.
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-13 20:08
    @Timothy:
    HA! I mean it has been in operation for a few months. Each alarm "talks" to another alarm on the system to be sure all is well. If one does not talk back, the alarm will go off. So far so good.


    @SuperCricket
    I'm using "FullDuplexSerial". I tested it with about 500' and it seemed to work right at 9600 baud.

    Post Edited (Computer Geek 101) : 11/13/2008 8:39:35 PM GMT
  • nohabnohab Posts: 96
    edited 2008-11-15 16:22
    Well, I did a little test as someone suggested.
    The only wire long enough I found was a telephone type cable (but with 6-conductor, no shield)
    It's still on a spool, I don't know if this is bad or good for interference, but I didn't want to unroll it.
    The spool was 100m/328feet when it was new. About half is used so it should be 150 feet, probably more.
    I connected 3 wires, one for ground and one for data in each direction (but in test only one direction is used), and wrote two small testprograms using FullDuplexSerial) and then started of at 2400. No problem.
    I slowly increased the speed and reached 23800 before the first transmission error occured, quite impressive !

    I have to do more tests, with unrolled cable and in amore noisy environment, but the margin looks good sofar.

    Thanks everyone and specially Computer Geek 101 whose Fire alarm system convinced me to test without extra drivers etc.
  • parskoparsko Posts: 501
    edited 2008-11-15 17:03
    We've seen this come up a few times before. I can't seem to figure out why no one suggests ethernet cable? Wouldn't that suppress the noise quite well? Telephone line isn't twisted pair, but ethernet is. I would assume that you'd be able to get longer distances with ethernet cable over telephone cable. On top of that, you can buy a whole 500foot spool kit on Ebay that will include the wire, the ends, color coated end covers, and tester, for about $50! You could wire a large house (or business) with this kit. Here is an example for $37

    -Parsko
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-11-15 18:58
    "Telephone line isn't twisted pair, but Ethernet is" - I think that general Telephone cable is supposed to make one complete twist every 3 feet, but that's all four wires as a group not individual pairs unless it's a specialty phone cable which might actually have two twisted pairs. Ethernet cable would be ideal, since it inherently is designed with low capacitance, speed and distance in mind.


    Ribbon cable will also work well if you have multiple data paths you can separate each data path with power or GND to minimize any cross talk.


    GND
    GND
    D0
    D0
    GND
    GND
    D1
    D1
    GND
    GND

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 11/15/2008 7:09:29 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-15 19:21
    The best way to take advantage of twisted pair cable is to use differential signalling, such as RS485 or RS422. Nohab wanted something simple, without resorting to external active transceivers, and it looks like he's found it. I would be interested, though, in seeing how much his transmission speed could be increased with the simple addition of resistive termination networks at the receiving ends of the cable and some series resistance on the transmit ends. I don't know what the characteristic impedance of RJ-11 cable is, but I'd start with a series resistance of 120 ohms on the transmit side, along with a voltage divider on the receive side comprised of two 240-ohm resistors, one to Vdd, the other to Vss. A little hysteresis on the receive end wouldn't hurt either. 10K from a feedback pin to the divider node would probably work fine.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
  • hippyhippy Posts: 1,981
    edited 2008-11-15 19:33
    I've run DMX-512 (RS485?) through 1km of two-core plus earth mains cable at 250kbaud with an arc welder firing above the loops of cable and had no problems.
Sign In or Register to comment.