Shop OBEX P1 Docs P2 Docs Learn Events
broadcast rs-232 transmission? — Parallax Forums

broadcast rs-232 transmission?

Egon 4uEgon 4u Posts: 13
edited 2007-11-14 19:38 in BASIC Stamp
I need to broadcast RS-232 data to 10 CD players. The players have RS-232 DB9 connectors. The broadcast is needed to synchronize the players (good accuracy needed).

I don't need to receive data, so it's just two connections per player (rx, gnd).

I would like to use the Stamp 2's SOUT pin, which already has a line driver. But I'm thinking I can't just connect this to 10 different rx pins.

Can somebody recommend a part to put in between my STAMP 2 and the 10 players?

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-11-14 10:44
    The Stamp's SOUT pin needs the voltage on the SIN pin to transmit RS232 signals.
    Also, parallel connection of 10 receivers will weaken the signal.
    A better approach is to use a MAX230 (5 transmitters) where each transmitter
    connects to 2 receivers. There should be no problem driving the 5 inputs on the MAX230
    from a single stamp I/O pin.
    Max230 datasheet:
    http://pdfserv.maxim-ic.com/en/ds/MAX220-MAX249.pdf

    regards peter
    ·
  • steve_bsteve_b Posts: 1,563
    edited 2007-11-14 14:23
    "good accuracy needed"....are all these cd players in the same rack?
    If they are at the ends of different cable lengths, you might find they are not as synced as you'd like (as the signal takes a bit longer to get to the end of the long line)...again, depends on how much accuracy you need!

    (then again you might look at the response time of each cd player; as I'm sure each one has a different "setup" speed -- takes time to get the cd in the tray spinning etc..)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <FONT>Steve



    What's the best thing to do in a lightning storm? "take a one iron out the bag and hold it straight up above your head, even God cant hit a one iron!"
    Lee Travino after the second time being hit by lightning!
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-14 15:29
    steve_b,
    The transmission time of the signal would not at all be significant.
    The distances are too short and the fractions of a microsecond would be swamped by the delays in the mechanics of the cd players.
  • Egon 4uEgon 4u Posts: 13
    edited 2007-11-14 15:50
    OK, I'll try two MAX 230s. One I/O pin (not SOUT) connected to 10 TTL lines. Can a single I/O pin drive so many inputs? The 230 data sheet does not mention what the current draw is on the input pins during normal operation. Don't I need a resistor/transistor, hooking the collector to the 10 input pins (emitter to gnd)?

    I'm not sure what you mean by, "A better approach is to use a MAX230 (5 transmitters) where each transmitter connects to 2 receivers. " I assume you mean that a single I/O pin from the stamp is connected to T1N, T2N, ..., T5N on both 230s (total of 10 connects for one pin). If not, please clarify.

    Regarding the CD players, they are all (according to spec) synced if serial commands are issued at same time. Cable length is a good point. But they will be short cables, since the STAMP box and the CD players will all be in the same proximity. There is no tray opening, and they are all paused on the same track before the "play" command is issued.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-11-14 16:07
    One transmitter output (from MAX230) can easily drive two receiver inputs (at CD's),
    so you can use just one max230.
    The stamp I/O pins can source/sink 25mA so no problem driving 10 TTL inputs (when using
    one max230 there are only 5 inputs).

    regards peter
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-14 16:11
    As a general rule, I/O pins can drive at least 10 inputs, particularly if we're not talking about blazing speeds (nanoseconds). Just connect the Stamp I/O pin to the MAX230 TTL/CMOS inputs. Note that you'll need to use inverted mode for the SEROUT statement Baud constant (see the Stamp manual for details).

    Truthfully, you can probably use a single MAX230 and connect several CD players in parallel. One RS232 driver can often drive several RS232 inputs without any problem at all.
  • Egon 4uEgon 4u Posts: 13
    edited 2007-11-14 16:17
    ok, peter, now I understand. Thanks.

    I'm a little worried about reliability here, though. The CD player is extra rugged, guaranteeing sync when I follow the procedure that I listed above correctly. However, if I drive two CD players with one MAX 230 driver, is there any chance that sometimes it won't work? Would I be safer using two MAX 230 devices?

    I just want to be extra sure, as this app will run for over a year, every day, and it can not work just 95% of the time.
  • Egon 4uEgon 4u Posts: 13
    edited 2007-11-14 16:23
    mike,

    is there a way to quantify how many inputs a single I/O pin can drive in this case? It's RS-232, 4800 baud.

    is there a way to quantify how many rs-232 devices a single driver in the MAX 230 can drive?

    I want to keep my margins wide.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-14 16:28
    Egon 4u,
    There is always a chance that it sometimes won't work, even if you provide a separate MAX230 output for each player.
    There can be electrical noise. Someone may start up a floor waxer nearby and put a huge voltage spike on the power
    supply. Maybe the waxer's motor will induce noise currents in the several feet of cable that run to the players. These
    things happen. That's why there are closed loop systems where the controller (the Stamp) receives some kind of feedback
    from the players and can reset and reinitialize them somehow if something goes wrong.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-11-14 16:37
    Page 4 of the datasheet, graph "Output current versus data rate"
    shows that the used capacitors on the max230 determine maximum baudrate.
    Since each rs232 reciever input has a 5kOhm input resistance typical,
    each rs232 input draws about 2.5mA, and two receivers parallel draw about 5mA.
    When using 0.1uF capacitors, baudrate is limited to 45kbits/s.
    Use 1uF capacitors and you should have no troubles.

    regards peter
  • Egon 4uEgon 4u Posts: 13
    edited 2007-11-14 17:24
    peter, if each rs232 input draws 2.5 mA, does that mean the stamp I/O pin is supplying 2.5 mA per rs232 input? If so, then that means the stamp must provide 25 mA for 10 rs232 devices?

    mike, I have certain parameters in my control at this stage. I want to optimize my choice of each one. If a floor waxer makes it fail, fine, but if a floor waxer makes it fail on the same day that it failed twice for my poor design, not fine. And there is feedback from the CD players (not through serial interface) to let me know if it's running or not.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-11-14 18:39
    The 2.5mA per receiver is delivered by the MAX230 output drivers, not the stamp I/O pin.

    regards peter
  • Egon 4uEgon 4u Posts: 13
    edited 2007-11-14 19:09
    thanks, peter. question still remains, what is the stamp i/o pin putting out?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-11-14 19:38
    The largest current into the stamp I/O pin would be 0.4mA per connected max230 input
    when the stamp pin output is low. (0.4mA sink is typical for TTL), so for 5 connected
    inputs the total sink current should be approx. 2mA. When the stamp pin is high,
    the current·supplied by the stamp pin is much less than that.

    regards peter
    ·
Sign In or Register to comment.