Shop OBEX P1 Docs P2 Docs Learn Events
Serial connection with 20ft cable? — Parallax Forums

Serial connection with 20ft cable?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-09-12 17:22 in BASIC Stamp
So i really didnt want to use another USB port for my bs2 I already have way to many USB/rs232 converter and usb hubs everywhere! My bs2 is working fine ive uploaded programs to it via USB and the serial cable that came with it. Now I have a what I believe is a 20ft cable plugged into com1 so I can have a serial port sitting on desk. 20ft is unnecessarily long but the 5fter that came with the stamp isnt long enough. Anyways the stamp editor cant find my HW board when plugged into this cable, I tested the voltages on the pins with a meter and they are all right, producing +11.4 and -11.4. Im assuming the cable is probably fine does a cable this long just have to much ringing or something to work? I know when designing serial/parallel based cables to program AVRs they can only be a few inches becuase of the ringing problem, but I would suspects a commercially produced shielded cable should at least work....

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-09-10 14:28
    Are you sure the RX/TX lines aren't reversed as is the case with a null-modem cable?
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-10 15:16
    Hmmm this is kind of odd, i plug the cable in run a voltage test

    pin 1 DCD is a few mv
    pin2 RxD is -11.4v
    pin3 TxD -11.4v

    im not sure what Tx and Rx are supposed to be at be default. I tried a continuity tester and it said Tx are pin 3 on both sides, pins 1 and 2 tested bad yet pin 2 is spitting out -11.4....... I stuck a pin header in the female end to so id would know the meter was making contact on that side for the continuity test...
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-09-10 15:52
    I have four 6-foot cables connected together - works good.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-09-10 15:55
    Have you verified the pins using a simple continuity test to check that they're not shorted or crossed over?
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-10 17:00
    @PJ ok i wasnt sure if serial connections could be ran that long, every schematic ive ever followed to make a serial programmer make a big deal out of cable length, as I assumed that must be for unsheilded wiring.

    @Chris yes my post above explains, i ran a continuity test but got super flaky results, its telling me pins 2 to pin 2 isnt continous but then pin 2 is carrying 11.4 volts..

    Im just gonna chalk this up to bad cable, weird this thing is hardly used.
  • pacmanpacman Posts: 327
    edited 2012-09-11 03:29
    I have worked with a serial cable close to 500m long. Baud rate was something less than 45bps (this was back when 300bps modems were 'super fast'). Black box 'signal boosters' on either end...

    Suffice to say it was a very slow process....

    Check for 'kinks' in the cable. Also start at one end and move along it wigging two spots a couple of inches apart - you might find an intermittent core - been know to happen (especially on much flexed cable). Using this method you might be able to get a goodly long enough length to still work with..

    Other things to check for.. A nick in the outer insulation, a cable crush (it's not under one of the table legs is it?), water ingress. These are all thing I have seen and had to deal with....
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-09-11 16:03
    I agree with Pacman. Years ago installed several Serial cables for a machine shop to send data to CNC machines that were over 75 feet and had no issues because of the length.
  • vaclav_salvaclav_sal Posts: 451
    edited 2012-09-12 07:00
    Serial / RS 232 /EIA 232 is one of the best defined standards and the length is defined by capacitance of the cable – for all practical purposes it is good for up to 300 meters.
    In your case length is non issue.
    Instead of fooling around with measuring voltage ( can be +_3V to 25 V) , start with editor “Run / Identify”.
    With no power applied to the BS2 you should at least read Loopback Yes ( hardware conected), than with power on the BS2 you should get Echo Yes and proper identification of your chip ( communication OK).
    If that fails than just check the cable continuity.
    I do not want to get picky here, but most failures of this kind are due to mismatch of serial ( COM) ports and wrong kind of serial cable.
    You mentioned that you have more serial / USB connections – so I would suspect improper COM port
    selection.
    Another time honored method of troubleshooting – use known components.
    Do you have another working serial cable?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-09-12 08:28
    Try building a diagnostic device to confirm connectors and signal levels. 20 feet shouldn't be a problem. Use LEDs to indicate activity and appropriate resistors.
  • vaclav_salvaclav_sal Posts: 451
    edited 2012-09-12 10:28
    Try building a diagnostic device to confirm connectors and signal levels. 20 feet shouldn't be a problem. Use LEDs to indicate activity and appropriate resistors.
    Or in 21st century use free serial port diagnostics software.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-09-12 11:37
    vaclav_sal wrote: »
    With no power applied to the BS2 you should at least read Loopback Yes ( hardware conected), than with power on the BS2 you should get Echo Yes and proper identification of your chip ( communication OK).
    If that fails than just check the cable continuity.

    As a note I believe even with a crossover cable it is possible to get echo. Loopback, while great for troubleshooting is not required for the editor to identidy and program a BASIC Stamp Module. Echo is required, but if the RX/TX are backward it won't work.
  • vaclav_salvaclav_sal Posts: 451
    edited 2012-09-12 16:34
    As a note I believe even with a crossover cable it is possible to get echo. Loopback, while great for troubleshooting is not required for the editor to identidy and program a BASIC Stamp Module. Echo is required, but if the RX/TX are backward it won't work.

    Hi Chris,
    I mentioned loopback because it does identify /check some RS232 signals( hardware) thru the BS2 true serial port. Unplug the cable and you get Loopback No.
    As far as echo goes I have never satisfactory answered that to myself. I believe there was an opinion that it is strictly used for COM echoing the send data to the editor. Sort of "local loopback".
    To my knowledge the chip identification is the only sure way to know that the serial link is working,
    You are right , this may be as simple as low battery because that shuts down the CPU. My BS2e ( OEM) has the low voltage detector, but some schematics do not show that. Actually when I build my own BS2e OEM module I added "idiot LED" to make sure that the CPU is actually running.
    Maybe that is the "voltage" ( I don't recall the signal name ) the OP should check.
    That will be there even when no actual software is running, just CPU.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-09-12 17:22
    If you're using the output of the voltage detector to determine if the interpreter has shut down you should be buffering the signal that drives the LED. That said, echo is required for the editor to continue to identify and program the BASIC Stamp Microcontroller. If a known good cable works on it and the 20' cable does not, that's a pretty good indication the problem is in the cable or the way it is wired (or not wired).
Sign In or Register to comment.