S P I/Mic ro w ire -Co m p a t ib le
UART in QS OP -1 6
DIRECT
OPTO-COUPLER
DRIVE
IR MODULE
DRIVE
OR
+5V
330Ω
MAX310
MAX3221
IR LED
TX
+5V
TXD
RXD
TX
RX
8051
1/6 HC00
100Ω
IR
MODULE
MAX3100
1.8432MHz
3100
0.1µF
IRQ
RX
10k
1/6 HC00
22pF
22pF
Figure 10. Bidirectional RS-232 IrDA Using an 8051
The software routine (Figure 12) begins by reading the
DIP switch on port RB. The switch data includes 4 bits
for the baud rate, 1 bit for number of stop bits, 1 bit for
a word length of 7 or 8 bits, and 1 bit for delay between
messages. The PIC reads the switch only at initializa-
tion (re s e t), a nd p rog ra ms the p a ra me te rs into the
MAX3100. It then begins sending the message repeat-
e d ly. If the d e la y b it is s e t, it ins e rts a 1s e c d e la y
between transmissions. As in the 8051 example, the
main routine is called UTLK, and can be used in any
PIC-based, port-pin-interfaced application.
In t e rfa c e t o P IC P ro c e s s o r
(“Qu ic k Bro w n Fo x ” Ge n e ra t o r)
Figure 11 illustrates the use of the MAX3100 with the
®
PIC . This circuit is a “Quick Brown Fox” generator that
repeatedly transmits “THE QUICK BROWN FOX JUMPS
OVER THE LAZY DOG” (covering the entire alphabet)
over an RS-232 link with adjustable baud rate, word
length, and delay. Although a software-based UART
could be implemented on the PIC, features like accu-
rate variable baud rates, high baud rates, and simple
protocol selection would be difficult to implement reli-
ably. The 16C54 in the example is the most basic of the
PICs. Thus, it is possible to implement the example on
any member of the PIC family.
PIC is a registered trademark of Microchip Corporation.
16 ______________________________________________________________________________________