Subject: Re: rs232 cable splitting/sharing
To: None <netbsd-help@NetBSD.org>
From: Johnny Billquist <bqt@update.uu.se>
List: netbsd-help
Date: 05/27/2006 15:49:43
Sorry, but you need to learn a bit more about basic electronics. ;)

If you have two transmitters wired in parallell, both outputting +12V, 
the result will be +12V, not +24V.

The receiver is never at risk in this setup. However, the transmitters 
might be. If one tries to output +12V and the other tries to output 
-12V, they will work against each other, and that could possibly 
overload the drivers, burning them up. Most circuits nowadays have 
current protection built in, so that they will not drive the output with 
more than a few hundred milliamps at most, which is low enough to not 
start frying things.

In order to get +24V, you should connect the +12V output from the first 
transmitter to ground on the second, and then measure between ground of 
the first one, and +12V of the second one. Then you'll see +24V.
Same a battery.

However, for data communication, having several transmitters will most 
of the time simply not work. The reason is the thing mentioned above. 
RS-232 uses -+ voltage for 0 and 1. And they are both actively driven by 
most circuits. Which means they must both be transmitting the same data 
at the same time for the signal to get to the receiver correctly. If one 
wants to transmit a 0, and the other a 1, one of the signals will 
definitely be lost. And we could dive deeper into this, but suffice to 
say that it's not neccesarily transmitter A who always wins over 
transmitter B either (but if that was the case, then it would be 
equivalent to just having transmitter A connected).
So data will be garbled based just on the voltage levels.
(Oh, and RS-232 is specified as something like 5-15 volts, both + and -, 
so we have a fairly large range to play with, and even though 0V isn't 
actually legal, it is usually accepted as the same as a negative level).

Then you also have the timing issues, as mentioned, the "normally" 
asynchronous characteristic of the signal.

If you really want to play with several transmitters to one receiver, it 
can be done under special circumstances. If you have transmitters that 
only drive a negative voltage, and leaves the output in a floating state 
instead of feeding the positive, you can then wire the positive with a 
pullup resistor. That will allow any of the transmitters to pull down 
the signal, and at idle, the signal stays positive. If you then 
(somehow) make sure that only one transmitter at a time is sending, then 
you will have a working setup.

	Johnny


James K. Lowden wrote:
> Tomas D wrote:
> 
>>what
>>would happen if both systems tried to send data over serial connection
>>at the same time? 
> 
> 
> At best the receiving device would get garbage.  At worst you'd damage one
> or more devices.  
> 
> RS-232 works by raising and lowering voltages on the signal lines.  The
> succession of voltage/no voltage detected on the receiving end is
> interpreted as a series of ones and zeros.  
> 
> For it to work, the timing in critical.  (You're probably accustomed to
> using RS-232 in async mode, but it can be used in synchronous mode to,
> where some of those 25 pins are dedicated to carry a time signal.)  Two
> machines transmitting over the same wire will not be able to coordinate
> their timing.  Consequently the receiver will see not a neat succession of
> on/off, but some "syncopated" sequence it won't be able to interpret.  
> 
> As for the worst case, remember that the RS-232 spec calls for voltages of
> IIRC +/- 12 volts.  If two machines apply 12 volts simultaneously, there'd
> be 24 on the line.  Let's only hope all the attached hardware is designed
> to tolerate 2x the specificed voltage, because otherwise it's toast.  
> 
> Of course, this is just a specific instance of the general case: for two
> processes to share a device, either they have to cooperate or they need an
> arbitrator.  
> 
> HTH.  
> 
> --jkl

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol