e017041.PDF

(509 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
SUMMER CIRCUITS COLLECTION
041
Electrically Isolated RS232 Adapter
data flow from an external device to the microcontroller,
the solution is easy. Since the RxD input of the microcon-
troller works with a +5-V level, all that we need is an opto-
coupler (IC2) whose LED is directly driven by the TxD out-
put of the external device via resistor R2. This resistor also
limits the current through D4 when TxD is inactive and thus
has a negative level (usually around –9 V). During data
transmission, the level of the pulses changes to around
+9 V. The collector of IC2 is connected directly to the RxD
input of the microcontroller. Resistor R5 is needed if micro-
controller RxD input does not have an internal pull-up resis-
tor. In any case, the microcontroller side of IC2 thus works
with TTL levels.
If we now want to send data from the microcontroller to the
external device, the microcontroller level (+5 V) must be
converted into an RS232 level of at least +6 to +7 V. To
achieve this, the negative voltage present at the RS232 TxD
output is tapped off by D1 and buffered by C1, which acts as
a storage capacitor. IC1 is a CMOS 40106 IC containing six
inverting Schmitt triggers.
One of these Schmitt triggers (IC1a) is wired with C2 and R1
as an oscillator. It generates a frequency of around 1.5 kHz.
This signal is fed to the other five Schmitt triggers, which are
connected in parallel and act as a driver. They provide the
necessary output current. When the output is Low, C3
charges to the supply voltage level via D2 (less the voltage
drop across the diode). When the output changes to High,
the voltage on C3 rises and adds to the voltage already pre-
sent; D2 blocks and C4 is charged via D3 to nearly twice the
A. Schiefen
This circuit represents an interface con-
verter between the UART pins of a micro-
controller (with TTL levels) and a ‘stan-
dardised’ RS232 port with symmetric
IC1.B
3
4
1
IC1.C
IC1 = 40106
R1
10k
15-
V levels. In contrast to the commonly
used IC solutions such as the MAX232, it
also provides electrical isolation between
the two sides of the converter. This inter-
face converter inverts the signals, so the
usual inverters on the microcontroller
side can (and must!) be omitted.
In most cases, the data lines RxD and
TxD are all we need for communications
with microcontroller systems. Fortu-
nately, handshake signals are very sel-
dom exchanged. The related RS232
leads are thus interconnected in such a
manner that communications can take
place without any problems.
All that is needed for the electrical isola-
tion of a signal is an optocoupler. If the
5
6
1
IC1.A
IC1.D
C3
D3
+5V
R4
470
1
2
9
8
1
1
IC3
8
BAT85
4µ7
16V
IC1.E
6
2
11
10
1
C4
C2
D2
IC1.F
100n
4µ7
25V
13
12
BAT85
1
5
7
6N136
3
TxD
K1
R3
D1
1
6
R5
BAT85
2
RxD
7
RxD
R2
2k2
3
TxD
IC2
8
2
8
6
4
C1
7
D4
9
C5
IC1
14
5
100n
100µ
16V
1N4148
GND
3
7
5
Sub-D
GND
6N136
000082 - 11
76
Elektor Electronics
7-8/2001
855735878.116.png 855735878.127.png 855735878.137.png 855735878.148.png 855735878.001.png 855735878.012.png 855735878.023.png 855735878.034.png 855735878.045.png 855735878.056.png 855735878.067.png 855735878.073.png 855735878.074.png 855735878.075.png 855735878.076.png 855735878.077.png 855735878.078.png 855735878.079.png 855735878.080.png 855735878.081.png 855735878.082.png 855735878.083.png 855735878.084.png 855735878.085.png 855735878.086.png 855735878.087.png 855735878.088.png 855735878.089.png 855735878.090.png 855735878.091.png 855735878.092.png 855735878.093.png 855735878.094.png 855735878.095.png 855735878.096.png 855735878.097.png 855735878.098.png 855735878.099.png 855735878.100.png 855735878.101.png 855735878.102.png 855735878.103.png 855735878.104.png 855735878.105.png 855735878.106.png 855735878.107.png 855735878.108.png 855735878.109.png 855735878.110.png 855735878.111.png 855735878.112.png 855735878.113.png 855735878.114.png 855735878.115.png 855735878.117.png 855735878.118.png 855735878.119.png 855735878.120.png 855735878.121.png 855735878.122.png 855735878.123.png 855735878.124.png 855735878.125.png 855735878.126.png
 
SUMMER CIRCUITS COLLECTION
supply voltage. A voltage of around +9 V is thus available
from C4, which is connected to the collector of optocoupler
IC3. In principle, the voltage level at an RS232 interface
should be +12 V to +15 V, but PCs can generally work with
significantly lower voltages. Notebook computers in partic-
ular sometimes have a voltage of only +8 V.
The emitter of IC3 leads to the RxD input of the RS232 port
and is held at around –9 V by R3. When the microcontroller
transmits data, the pulses from the TxD output of the micro-
controller arrive at the LED of optocoupler IC3. The tran-
sistor of IC3 switched on and applies the positive voltage
to the RxD input of the external device.
Normal diodes (1N4148) can also be used in place of the
Schottky diodes, although the generated voltages will be
somewhat lower. The 6N136 optocoupler is a high-speed
type; normal optocouplers are not suitable. The circuit can
theoretically transmit data at up to 57,600 baud, but in prac-
tice microcontroller circuits only use 9600 baud. These data
transmission rates have been successfully used with both
older-model and more recent notebook computers.
(000082-1)
855735878.128.png 855735878.129.png 855735878.130.png 855735878.131.png 855735878.132.png 855735878.133.png 855735878.134.png 855735878.135.png 855735878.136.png 855735878.138.png 855735878.139.png 855735878.140.png 855735878.141.png 855735878.142.png 855735878.143.png 855735878.144.png 855735878.145.png 855735878.146.png 855735878.147.png 855735878.149.png 855735878.150.png 855735878.151.png 855735878.152.png 855735878.153.png 855735878.154.png 855735878.155.png 855735878.156.png 855735878.157.png 855735878.158.png 855735878.002.png 855735878.003.png 855735878.004.png 855735878.005.png 855735878.006.png 855735878.007.png 855735878.008.png 855735878.009.png 855735878.010.png 855735878.011.png 855735878.013.png 855735878.014.png 855735878.015.png 855735878.016.png 855735878.017.png 855735878.018.png 855735878.019.png 855735878.020.png 855735878.021.png 855735878.022.png 855735878.024.png 855735878.025.png 855735878.026.png 855735878.027.png 855735878.028.png 855735878.029.png 855735878.030.png 855735878.031.png 855735878.032.png 855735878.033.png 855735878.035.png 855735878.036.png 855735878.037.png 855735878.038.png 855735878.039.png 855735878.040.png 855735878.041.png 855735878.042.png 855735878.043.png 855735878.044.png 855735878.046.png 855735878.047.png 855735878.048.png 855735878.049.png 855735878.050.png 855735878.051.png 855735878.052.png 855735878.053.png 855735878.054.png 855735878.055.png 855735878.057.png 855735878.058.png 855735878.059.png 855735878.060.png 855735878.061.png 855735878.062.png 855735878.063.png 855735878.064.png 855735878.065.png 855735878.066.png 855735878.068.png 855735878.069.png 855735878.070.png 855735878.071.png 855735878.072.png
Zgłoś jeśli naruszono regulamin