a MicroConverter Technical Note – uC006

advertisement
MicroConverter® Technical Note – uC006
A 4-wire UART-to-PC Interface
a
INTRODUCTION:
Connecting a PC to your MicroConverter chip for
downloading or debugging code requires an RS-232
line driver/receiver chip to step the UART’s CMOS logic
levels up RS-232 levels. If you don’t already have an
RS-232 chip in on your MicroConverter design, this
“4-wire UART” dongle can greatly simplify
PC-to-MicroConverter connection allowing no-hassle
in-system download/debug access without adding
components to your board.
IMPLEMENTATION:
The circuit of Figure 2 is nothing more than a standard
RS-232 line driver/receiver block. In many applications
(and on MicroConverter evaluation boards) this circuit,
or one very much like it, is included on the same PC
board as the MicroConverter itself. As shown in Figure
1, however, the RS-232 transceiver circuit sits on a tiny
Figure 1: Connecting for Download or Debug
board connected by a 9-pin D-SUB (J1) to a PC’s serial
port. The 4-conductor ribbon cable at the other end of
this small board can be connected directly to 4 pins of the MicroConverter, allowing a simple pin-header on the
MicroConverter board to provide full download/debug access to the chip. In addition to carrying the
MicroConverter’s RxD & TxD (UART receive & transmit) signals, the ribbon cable carries the MicroConverter’s
VDD line to power the RS-232 chip, thus avoiding the need for an additional power source.
WHAT ABOUT RS-485?
So we’ve described a simple solution for downloading and debugging MicroConverter code in designs without any
resident networking hardware of any kind. But what about designs that feature resident networking hardware
other than RS-232 (such as RS-485)? Simply adding the RS-232 connection could cause contention in these
cases. One solution to this dilemma is illustrated in Figure 3. Basically, you just add two extra pins (RE & DE) to
C1
C3
0.1uF
C4
to PC
C2
9
8
7
0.1uF
0.1uF
0.1uF
U1
1
C1+
2
V+
3
C1-
4
C2+
5
C2-
6
V-
7
T2OUT
8
R2IN
VCC 16
GND 15
C5
0.1uF
T1OUT 14
R1IN 13
to chip
VDD
R1OUT 12
T1IN 11
RxD
TxD
T2IN 10
R2OUT 9
GND
4-conductor
ribbon cable
ADM202
6
5
4
3
2
1
J1, 9-pin D-SUB
Figure 2: Schematic of the “UART Dongle”
Ver 1.2 – 14 Sept 2000
-1-
http://www.analog.com/microconverter
MicroConverter® Technical Note – uC006
A 4-wire UART-to-PC Interface
a
+5V
+5V
RE
VDD
to RS-232
dongle
RxD
TxD
GND
ADuC8xx
DE
+5V
RxD 16
(port pi n)
TxD 17
1
RO
2
RE
3
DE
4
DI
VCC 8
A 7
B
6
GND
5
to RS-485
network
ADM1485
the RS-232 dongle header, and use
these pins to automatically disable
the RS-485 chip whenever the
RS-232 dongle is inserted.
During normal operation, the
dongle is left open and RS-485
communication goes on
unimpeded. But by inserting the
RS-232 dongle, RE and DE get
pulled to VDD and ground
respectively, thereby automatically
disabling the RS-485 transceiver to
allow RS-232 communications.
BOARDS:
Simple board layouts for the
RS-232 dongle PC-board are given
below.
Figure 3: RS-232 Download Option for RS-485 Enabled System
Figure 4: Silk Screen
Ver 1.2 – 14 Sept 2000
Figure 5: Solder Side
-2-
Figure 6: Component Side
http://www.analog.com/microconverter
Download