1
\$\begingroup\$

I have't been able to find a solution, and was hoping for some clarity. I have 2 machines (one is a bill counter, one is a coin sorter) that both support printing over DB9 serial connection, and one printer that has a 25 pin input.

The goal is to have the single printer handle printing for both units through a y-split. On the bill counter in this setup, I am able to print from the bill counter with minor data corruption (a few odd characters interspersed), but am unable to print anything from the coin sorter. Either singulated unit plugged into the Y cable works independently with the other unit not plugged in, the cable integrity and pinouts seems fine. For both units, in theory, they should only be communicating with the printer when a manual print request is initiated, but I do not have access to either protocol manual, or port testing equipment, just a standard DMM.

Do I need to filter each comm line with diodes? Any insight as to why the other unit wouldn't print when both devices are attached?

Please let me know your thoughts or what additional information I may provide to help drive finding a solution.

Thank you!

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Ordinary RS232 type serial ports are indeed not designed to have multiple drivers. You could try a diode-resistor logic type of solution as you are thinking, but only provided that the machine's attempts to transmit are separated in time. And that is not as robust as the designed line drivers would be against distance or noise. Back in the day there were automatic printer sharing switches; you could still make your own with a microcontroller, even getting as fancy as a "store if busy and replay later" scheme. \$\endgroup\$ – Chris Stratton Jun 5 '18 at 21:05
2
\$\begingroup\$

Any insight as to why the other unit wouldn't print when both devices are attached?

Yes. An idle device will try to drive the Tx line to some negative voltage (anywhere from -3V to -15V), while the active device either tries to drive it to some possibly different negative voltage or, tries to drive it to some positive voltage.

Sounds like the line driver for the bill counter's RS-232 port has a lower output impedance than the line driver for the coin sorter, so the bill counter "wins" (sort of) when the two drivers want to force the line to opposite polarities.

Hopefully, the outputs of both devices are protected against wiring mistakes (short circuits, etc.) and you won't have smoked any transistors.

Do I need to filter each comm line with diodes?

You could use diodes to ensure that the two drivers are only capable of driving the line high, but then you'll need a resistor connected to a negative supply voltage, to pull the Tx line low when neither device is talking. The pull down resistor value must be low enough to pull the signal down quickly so that the printer sees the correct value for the next data bit, but the value also must high enough that either device can overpower it.

The range of resistor values that will work will be narrower at higher baud rates, and it may be closed (no value will work) at the baud rate you need.


A better approach would be to build an active circuit with two separate RS-232 receivers, an OR gate, and one RS-232 transmitter.

Another approach would be to use some kind of microprocessor...

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Actually you don't need another negative supply, you can use a pulling resistor across each diode. \$\endgroup\$ – Chris Stratton Jun 5 '18 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.