Shop OBEX P1 Docs P2 Docs Learn Events
Serial cable length — Parallax Forums

Serial cable length

ArchiverArchiver Posts: 46,084
edited 2001-10-18 18:46 in General Discussion
The stamp programming manual outlines the use of a 22K resistor when using the
serin command (and direct connection when using the serout command). I've used
this setup successfully, but was wondering how long of a cable I can use,
without using a line driver? About 2' of cable seems to work well now.

This isn't for a production product, and I don't have to worry about connecting
to unknown serial devices.

Thanks,
Kevin

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-09-07 22:49
    If you are going to talk to a true serial device (PC, printer, etc...) with
    a regular Stamp pin, look into a MAX232 chip. One chip and 4 capacitors
    gives you two channels of true RS232.

    The resistor thing is a workaround to drop the voltage to Stamp levels.

    Original Message

    > The stamp programming manual outlines the use of a 22K resistor when using
    the
    > serin command (and direct connection when using the serout command). I've
    used
    > this setup successfully, but was wondering how long of a cable I can use,
    > without using a line driver? About 2' of cable seems to work well now.
    >
    > This isn't for a production product, and I don't have to worry about
    connecting
    > to unknown serial devices.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-07 22:59
    Yes, thanks, understood.

    But does anyone have any experience with the current limiting resistors approach
    and cable length? I'd guess this is highly dependent on the individual serial
    implementation on the other side of the line, just looking for others' data
    points.

    Thanks,
    Kevin

    Rodent wrote:
    >
    > If you are going to talk to a true serial device (PC, printer, etc...) with
    > a regular Stamp pin, look into a MAX232 chip. One chip and 4 capacitors
    > gives you two channels of true RS232.
    >
    > The resistor thing is a workaround to drop the voltage to Stamp levels.
    >
    >
    Original Message
    >
    > > The stamp programming manual outlines the use of a 22K resistor when using
    > the
    > > serin command (and direct connection when using the serout command). I've
    > used
    > > this setup successfully, but was wondering how long of a cable I can use,
    > > without using a line driver? About 2' of cable seems to work well now.
    > >
    > > This isn't for a production product, and I don't have to worry about
    > connecting
    > > to unknown serial devices.
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-07 23:16
    RS232 is spec'd for + / - 12 volts -- the Stamp can put out 0 to +5 volts.
    This is what limits your distance. I suspect 3-5 feet with a good 20 gauge
    or larger shielded cable may be pushing it.

    Receiving the RS232 signal with the Stamp should not be a problem -- the
    resistors drop the voltage to Stamp levels. Its the maximum of 5 volts the
    Stamp can put out transmitting the RS232 signal that can be an issue.

    Depending on the baud rate and the type of cable you have, you can get over
    500 feet with the MAX232's

    Original Message

    > Yes, thanks, understood.
    >
    > But does anyone have any experience with the current limiting resistors
    approach
    > and cable length? I'd guess this is highly dependent on the individual
    serial
    > implementation on the other side of the line, just looking for others'
    data
    > points.

    > > If you are going to talk to a true serial device (PC, printer, etc...)
    with
    > > a regular Stamp pin, look into a MAX232 chip. One chip and 4 capacitors
    > > gives you two channels of true RS232.
    > >
    > > The resistor thing is a workaround to drop the voltage to Stamp levels.
    > >
    > >
    Original Message
    > >
    > > > The stamp programming manual outlines the use of a 22K resistor when
    using
    > > the
    > > > serin command (and direct connection when using the serout command).
    I've
    > > used
    > > > this setup successfully, but was wondering how long of a cable I can
    use,
    > > > without using a line driver? About 2' of cable seems to work well
    now.
    > > >
    > > > This isn't for a production product, and I don't have to worry about
    > > connecting
    > > > to unknown serial devices.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-08 02:56
    Rodent wrote:
    >
    > RS232 is spec'd for + / - 12 volts -- the Stamp can put out 0 to +5 volts.
    > This is what limits your distance. I suspect 3-5 feet with a good 20 gauge
    > or larger shielded cable may be pushing it.

    Yep. From what I'm seeing there a number of interpretations of the 'spec'. I
    suspected the same thing, just thought I'd ask to see if anyone had actually
    fooled around with this.

    > Depending on the baud rate and the type of cable you have, you can get over
    > 500 feet with the MAX232's

    Yes yes, maxim is good, got it (I'd probably use an LTC part though), just
    thought I see what sort of experience folks had without using a line driver.

    Thanks,
    Kevin
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-08 19:03
    >The stamp programming manual outlines the use of a 22K resistor when using the
    >serin command (and direct connection when using the serout command).
    >I've used
    >this setup successfully, but was wondering how long of a cable I can use,
    >without using a line driver? About 2' of cable seems to work well now.
    >
    >This isn't for a production product, and I don't have to worry about
    >connecting
    >to unknown serial devices.
    >
    >Thanks,
    >Kevin


    Hi Kevin,
    There are 3 issues I think:
    1) capacitance of the cable degrades the signal.
    2) noise induced from outside sources fakes a signal.
    3) ESD from lightning or accidents, oops.

    #1 can be improved by operating at a lower baud rate. I have run 200
    feet at 300 baud at TTL levels for a kluged setup, through Belden
    8443 unshielded cable. Not a scientific test. Depends on the cable
    and on the resistance (RC time) driving the cable. If you are using
    a stamp, use no more than 220 ohms in series to drive the line.

    #2 Using shielded twisted pair cable can cut down the noise. However,
    shielded cables will have a higher capacitance. Noise can be awful
    on an unshielded cable. Of course, depends on where you are. The
    stamp input does not have any hysteresis, and the asymmetric
    threshold is not ideal if you are receiving TTL levels.

    Funny things can affect the results. Say your cable runs on the
    ground outdoors. It can work at first but stop working when it
    rains, because of changes in capacitance or noise. Or somebody can
    turn on a motor nearby. Okay for a kluge, but don't depend on it for
    the long term.


    #3 Well, ESD is separate issue.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-09 01:18
    Thanks for the reply.

    BTW, what's the 220ohm resistor for?
    I'll be driving this with a BS2 (maybe a PIC too, but I guess I can't
    admit to that on this list ;-)

    Kevin


    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >The stamp programming manual outlines the use of a 22K resistor
    when using the
    > >serin command (and direct connection when using the serout
    command).
    > >I've used
    > >this setup successfully, but was wondering how long of a cable I
    can use,
    > >without using a line driver? About 2' of cable seems to work well
    now.
    > >
    > >This isn't for a production product, and I don't have to worry
    about
    > >connecting
    > >to unknown serial devices.
    > >
    > >Thanks,
    > >Kevin
    >
    >
    > Hi Kevin,
    > There are 3 issues I think:
    > 1) capacitance of the cable degrades the signal.
    > 2) noise induced from outside sources fakes a signal.
    > 3) ESD from lightning or accidents, oops.
    >
    > #1 can be improved by operating at a lower baud rate. I have run
    200
    > feet at 300 baud at TTL levels for a kluged setup, through Belden
    > 8443 unshielded cable. Not a scientific test. Depends on the cable
    > and on the resistance (RC time) driving the cable. If you are using
    > a stamp, use no more than 220 ohms in series to drive the line.
    >
    > #2 Using shielded twisted pair cable can cut down the noise.
    However,
    > shielded cables will have a higher capacitance. Noise can be awful
    > on an unshielded cable. Of course, depends on where you are. The
    > stamp input does not have any hysteresis, and the asymmetric
    > threshold is not ideal if you are receiving TTL levels.
    >
    > Funny things can affect the results. Say your cable runs on the
    > ground outdoors. It can work at first but stop working when it
    > rains, because of changes in capacitance or noise. Or somebody can
    > turn on a motor nearby. Okay for a kluge, but don't depend on it
    for
    > the long term.
    >
    >
    > #3 Well, ESD is separate issue.
    >
    > -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-09 04:10
    At 12:18 AM +0000 9/9/01, kolalde@h... wrote:
    >Thanks for the reply.
    >
    >BTW, what's the 220ohm resistor for?
    >I'll be driving this with a BS2 (maybe a PIC too, but I guess I can't
    >admit to that on this list ;-)
    >
    >Kevin
    > > and on the resistance (RC time) driving the cable. If you are using
    > > a stamp, use no more than 220 ohms in series to drive the line.

    Hi Kevin,

    The 220 ohm resistor the output of the stamp is there simply to
    protect it from accidents. Anytime an IC pin (Stamp, PIC, HC11,
    '555, CD4011, whatever) is connected to the "outside world", it is
    prudent to put at least resistor in series just in case... The
    resistor limits fault currents. There are some chips specifically
    designed as "line drivers" where this is not necessary. You should
    not go overboard with the protection, because more resistance will
    slow down the signal.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-09 04:32
    Thanks. So I'm guessing the 220ohm value is choosen to be a balance between
    protection and lost signal. 5/220 = about 23mA. Any smaller and I'll go over
    the 25mA current sink limit, any larger and I needlessly loose signal strength
    if I'm just trying to protect against 5V, yes?

    Thanks again,
    Kevin

    Tracy Allen wrote:
    > The 220 ohm resistor the output of the stamp is there simply to
    > protect it from accidents. Anytime an IC pin (Stamp, PIC, HC11,
    > '555, CD4011, whatever) is connected to the "outside world", it is
    > prudent to put at least resistor in series just in case... The
    > resistor limits fault currents. There are some chips specifically
    > designed as "line drivers" where this is not necessary. You should
    > not go overboard with the protection, because more resistance will
    > slow down the signal.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-10 06:00
    >Thanks. So I'm guessing the 220ohm value is choosen to be a balance between
    >protection and lost signal. 5/220 = about 23mA. Any smaller and I'll go over
    >the 25mA current sink limit, any larger and I needlessly loose signal strength
    >if I'm just trying to protect against 5V, yes?

    Exactly!
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-18 18:35
    All,

    I have an application that requires me to periodically access the
    Stamp via the Serial port. It is located in an awkward position and I
    would like to bring a serial cable from the Stamp to a more
    convenient location. The board has decoupling capacitors to the DB9
    and to ground on the ATN line (as done on the BOE). I have a
    shorting plug that would hold ATN to ground at the remote serial
    port, when not in use.

    Thus my questions for the collective wisdom:
    1) How long a serial cable can I have between the computer and the
    DB9 on the Stamp board?

    2) Is the shorting plug sufficient to prevent false ATN interrupts to
    the Stamp? (Or is it really necessary?)

    Thanks for you input,
    Phil
  • ArchiverArchiver Posts: 46,084
    edited 2001-10-18 18:46
    At 05:35 PM 10/18/01 +0000, you wrote:
    >All,
    >
    > I have an application that requires me to periodically access the
    >Stamp via the Serial port. It is located in an awkward position and I
    >would like to bring a serial cable from the Stamp to a more
    >convenient location. The board has decoupling capacitors to the DB9
    >and to ground on the ATN line (as done on the BOE). I have a
    >shorting plug that would hold ATN to ground at the remote serial
    >port, when not in use.
    >
    > Thus my questions for the collective wisdom:
    >1) How long a serial cable can I have between the computer and the
    >DB9 on the Stamp board?
    >
    >2) Is the shorting plug sufficient to prevent false ATN interrupts to
    >the Stamp? (Or is it really necessary?)
    >
    > Thanks for you input,
    >Phil

    I have made 200ft runs with plain-jane 4-conductor telephone wire up
    through ceiling tile and over an area with heavy machinery without any
    problems. I did have a 1K resistor tied between the ATN and GND at
    the stamp location however.
    Beau Schwabe IC Mask Designer
    National Semiconductor Wired Communications Division
    500 Pinnacle Court, Suite 525 Mail Stop GA1 Norcross, GA 30071
Sign In or Register to comment.