Optical Isolation of EIA-232 Serial Communications

advertisement
Optical Isolation of EIA-232 serial communications
The optical isolator is implemented with a light- emitting-diode and
transistor .
The phototransistor can "see" the diode and develops a
current which is related to the amount of light. it sees . . . which, in
related to the amount of current passing through the light emitting
The two are sufficiently insulated to allow a 5000 volt difference .
a photocollector
turn, is
diode .
The PS2501 is designed to function as a switch . Thus the phototransistor is
either cut-off (0 collector current) or saturated (nearly 0 collector-emitter
voltage) . The relationship between LED current and light and light and
phototransistor collector current are not linear . But because we seek only
two states, cut-off and saturation, and thus can model the output as a switch
which is open or closed, we need only to specify a range of LED currents which
will guarantee those conditions .
Linear optical isolators are manufactured.
Usually they include a second, matched photo-transistor sensing the same LED
which is used in a feedback arrangement to control the current of the matched
phototransistor .
Operation of a phototransistor is pretty much similar to that of a normal
bipolar NPN silicon transistor except that the collector current is controlled
by light . . . which in turn is controlled by current through a light-emittingdiode . There is connection to the "base" .
Carriers are generated by
photons . . .so the device tends to be slow in turning off . The control curves
are shown in the data sheet . A family of curves is plotted for fixed values
of the LED forward current, IF . We want to design a circuit in which the
phototransistorwill be either "on" or "off" (saturated or cutoff) .
Consider
the following circuit in which an serial data transmitter providing levels
specified by the ETA-232 standard is used to power the LED and that the
phototransistor is developing a voltage which is sensed by a EIA-232 receiver .
The circuit uses two isolators in a "spdt" switch configuration . One switch
is on while the other switch is off . This configuration provides low source
impedance to both the "off" switch and the load.
It can be easily modified
for inverting or non-inverting operation .
In this example, the excitation
voltage for ISO-1 is provided by the circuit which houses it and powers the
EIA-interface .
Power for ISO-2 is derived from TD1 and DIR1, the transmitter
data and data-terminal-ready signals .
z.LX_
vz~=D-,
4RYnr-/ 1d
interface between EIA-232 port and
EIA-232 port implemented with MAX-232 transceiver
figure 1
EIA-232 says that a transmitter, transmi tting a "space" will supply a maximum
of 10 mA to a short circuit and that it must be able to develop at least +5
volts with a 3K load. So we know that the range of currents we can get with a
EIA-232 transmitter is 5/3 < i < 10 ma.
Let's plan on the worst and assume we
can get 5/3 = 1 .67 mA to drive the optical coupler's LED . This is what will
produce saturation an the phototransistor . Cutoff can be produced by reducing
the LED current to 0 .
The ETA-232 transmitter produces at least -5 volts for
a "mark" .
This will reverse-bias the LED and develop no light .
In fact, we
must protect the LED with a signal diode to absorb this current .
Taking a look at the specifications for the PS2501 we discover that the
current transfer ratio, CTR, ranges from 0 .8 to 1 .6 . Then IF = 1 .67 mA
results in CRT x IF = .8 x 1 .67 = 1 .3 mA = Ic So we must design the output to
draw less than 1 .3 mA in the worst case . All this current is available to
drive the receiver . . . which has in . input impedance 3k < Zin < 7k . This
doesn't quit meet EIA-232 but it is easily within the specification of the
MC1489 or MAX-232 integrated circuits used to implement the receiver .
? LO
., Z2me
v,. = ~ . l
t
,=
ve-
~~dN~t
V
14-
EIA transmitter
During "mark"
EIA transmitter
EIA receiver
During "space"
figure 2
Let's use the EIA-232 Receiver to sense the state of the phototransistor,
remembering that we are limited to 1 .3 mA or less through the phototransistor .
The receiver input looks like a resistance, 3K < RI < 7K.
It will interpret
an input, VR
as a "low" correctly if V,, < 0 .8 volts and as a "high" if Va, >
2 .4 volts . The input has "hysteresis", 0 .2 < V, < 1 .0 volts . Hysteresis is a
history-dependent difference in the input threshold voltage . What it says
here is that we must, in the worst case, always have signals greater that 1 .0
volt . . . the maximum hysteresis voltage .
For our worst-case, assuming the
saturated phototransistor looks like a short circuit compared with 3k then
we develop 1 .3 x 3k = 3 .9 volts for a space and -3 .9 volts for a mark. . . easily
satisfying the hardware requirements of the receivers .
Mark and Space levels, Vi- and Vl+, meeting ETA-232 are derived from TD1 and
DTR1 of the incoming communications port . Diodes D1-D4 and capacitors C1 and
C2 convert the AC "signal" to corresponding levels . If they are good enough to
send, then they are good enough to receive . Resistors R1 and R2 allow enough
voltage drop so that TD1 and I7TRl are never less than 5 volts
The interface between the optical isolator and the PC is a bit different . We
are building the circuit with the MAX-232 so we have access to its power
supply . . . and we could draw 1 or 2 mA from V+ and V- as well . These sources
are not available at the back of a PC .
Why use the MAX-232 between the optical isolator and the TIL logic that it
communicates with? "Takes less thinking" is the simple answer . If we
interface directly to the TIL logic, then we must understand the internal
workinVs of the logic . . . signal levels, currents, etc . The following circuit
is a direct interface to our TIL logic . . . but we are responsible for
understanding it .
OT-ctl
The circuit is marginal in the worst case . It cannot use the transmitted data
operating at minimum levels and guarantee that it can produce a return signal
which is not diminished .
We wouldn't want to fly to the moon with this
interfacing our rocket engine .
And things Vet worse as the components age . . . notice that the CTR degrades to
80% of its initial performance after 105 hours at 60°C . . . not impossible
conditions in a medical environment! If we use a more sensitive optical
isolator (CTR > 1 .2) then the circuit is not marginal in the worst case at &0
°C for 105 hours! This is not a problem for the IC's we have specified, but
it places us further from meeting EIA-232
Good design demands that you consider all realistically possible
condition . . . extremes of power supplies, temperature, component values, etc .
This example is a first cut at good design . Take a look at the example shown
in figure 18 of the MAX-232 data sheet . There are a bunch of potential
problems with it . A 22K resistor to a 5 volts supply biases the receiving
phototransistor . When the transistor is off (cut off) and if you are using a
typical MAX-232 receiver (input resistance = 5K) then the receiver input is
sitting at 0 .93 volts . . .which the receiver will likely interpret as a low .
The specifications for the receiver say that the lowest voltage that will be
correctly interpreted as a "high" is typically 1 .7 volts . So I would guess
the circuit shown in figure 18 won't work .
Now before thinking "what crocks!!! . . ." about the designer and the application
note, realize that the idea of using the isolator is sound and the engineer
who wrote the note probably built it and it worked . Just because something
works once, don't believe it will always work . And don't blindly follow
applications notes . Writing applications notes is often a "first-job" for new
engineers at component manufacturers .
Download