p6 of 11
26-Aug-10
USB-232
HW143-19
www.firmwarefactory.com
D+
Figure 3
USB-232
USB
1
2
3
4
Vss
D-
USB Pwr Sns
R30
Vdd
Vss
Self Power Source
R40
Vss
Both-powered Powered Device
If both self-powered and bus powered configurations are
possible, a circuit must be provided to switch over power
to USB power. An example sub-circuit is given in figure
4, where it is assumed that USB power is used when it
is available. To give self-power priority, place T2 so that
it switches the USB power line instead. D1 and D2
ensure that the two power lines are not in contention. If
the self-power source is 3.3V, the diodes will be
sufficient and T2 will not be required at all.
Figure 4
USB-232
Vdd
Self-Power Vdd
3.3V - 5V
R40
USB-Power Vdd
Vss
T2
R50
Self Pwr
Sns
USB Pwr
Sns
R30
D1
D2
Power Take-Off
A device should only draw current from the USB line
once USB configuration is complete and the host PC is
not is sleep mode. The AllSysGo# output (active low)
can provide such a switch using the sub-circuit shown in
figure 5. C4 / R6 provide a slow switch-on to prevent
inrush current exceeding USB power limitations. 1μF
and 100nF smoothing capacitors are recommended on
both self and USB power lines. The Low Pwr output
should be monitored if the device can draw more than
100mA.
AllSysGo
Vdd
Vout
T1
R1
R6
C4
Figure 5
RS232 DTE Emulation
The familiar 9-pin D-shaped RS232 port on older PCs is
know as Data Terminal Emulator configuration. This
means that TxD, RTS and DTR are outputs and RxD,
CTS, DSR, DCD and RI are inputs.
To provide a
complete RS232 DTE implementation, a MAX239 is
used to convert to RS232 voltage levels, as shown in
figure 6. The MAX239 is suitable for Vdd = 5V circuits.
For Vdd = 3.3V, a MAX3241 should be used.
R
es
et
#
P
G
D
V
dd
V
ss
TEAclipper
connector 1
5
OSC1
OSC2
D+
Vusb
Figure 6
USB-232
USB
C2
C3
X1
2
3
4
Vdd
Vss
Vdd
P
G
C
1
2
3
4
Vss
D-
Vss
C1
C6
C7
V
ss
C8
DCD#
DSR#
Suspend
RI#
AllSysGo#
Vdd
Vss
Reset#
Vss
R1x
PB1x
Send
One pushbutton
circuit for each input
(Active low shown)
DTR#
Buff Empty
Tx Ind
Rx Ind
Vdd
R2x
One LED circuit
for each output
(Active low shown)
T
xD
#
R
xD
#
R
T
S
#
C
T
S
#
S
us
pe
nd
#
MAX239
C33
Vdd
C34
Vss
C35
V+
V-
Vcc
Gnd
C1+
C1-
C2+
C2-
C31
C32
T
1i
n
T
2i
n
R
1o
ut
R
2o
ut
S
H
D
N
#
T
xD
23
2
R
T
S
23
2
R
xD
23
2
C
T
S
23
2
T
1o
ut
T
2o
ut
R
1i
n
R
2i
n
Vss
G
N
D
RS232
Connector
D
T
R
#
R
I#
D
S
R
#
D
C
D
#
D
T
R
23
2
R
I2
32
D
S
R
23
2
D
C
D
23
2
T
3o
ut
R
4i
n
R
5i
n
T
3i
n
R
3o
ut
R
4o
ut
R
5o
ut
R
3i
n
1
2
3
4
5
6
7
8
9
GND
DTR
TXD
RXD
DCD
RI
CTS
RTS
DSR
RS232 without a signal inverter
It is possible to generate acceptable RS232 signal levels
parasitically without the use of a signal inverter chip.
The implementation is subject to the following
limitations:
Hardware flow control is not implemented
Operation is half-duplex, i.e. you should not
transmit while data is being received
When the remote device sends a byte, it is
automatically echoed back
The use of pull-up and pull-down resistors may
limit the cable length below that normally
achievable
The remote device should have a ‘high’ signal
level greater than Vdd
The resistor value shown would consumes higher
current than is acceptable during standby.
It is ideal for applications such as a low-cost command
line interface. See figure 6 for details.
USB-232
TxD
RxD
TxD232
RxD232
Vss
Vdd
e.g. BSS84
e.g. BSS138
4K7
Fig 7.