Figure 10. Bidirectional RS-232 IrDA Using an 8051
Interface to PIC Processor
(“Quick Brown Fox” Generator)
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.
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 (reset), and programs the parameters into the
MAX3100. It then begins sending the message repeat-
edly. If the delay bit is set, it inserts a 1sec delay
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.
PIC is a registered trademark of Microchip Corporation.