Serial Port Complete - Latest Microcontroller projects

(lily) #1
Ports for Embedded Systems


 
"  
. 1


Hardware UARTs handle much of the burden of serial communications. If your
microcontroller has an available hardware UART, it makes sense to use it. For
applications that need multiple serial ports, some microcontrollers, including
the PIC18F8722 and other PIC microcontrollers, have multiple hardware
UARTs. The Rabbit 4000 microprocessor from Rabbit Semiconductor Inc.
(www.rabbit.com) has six on-chip asynchronous serial ports.

 
. 1


Another way to implement serial communications is via a firmware UART such
as the ports supported by the PICBASIC PRO and C18 compilers. These ports
can use any generic I/O pins for serial communications. Firmware ports can
have features not available on a hardware port. For example, PICBASIC PRO’s
firmware ports can use serin2 and serout2 statements with an optional FlowPin
parameter that specifies a pin to use for flow control. When using flow control,
a serin2 statement sets its FlowPin output to enable receiving data. A serout2
statement waits for its FlowPin input to be asserted before sending data. An
optional timeout value causes the code to jump to a label if the pin isn’t asserted
within the specified time. In most cases, however, a hardware UART’s capabili-
ties are more useful than the added features of a firmware UART.

0
. 1


Another way to add a serial port is via an interface to an external UART.




The 16550 UART used in PCs for many years has eight data pins plus various
address, status, and control pins. Many microcontrollers don’t have enough
port pins to interface to this and similar chips. An alternative is a UART with a
synchronous serial interface.

#  ";
,
 !#5
A chip that requires as few as three lines for a bidirectional link is Maxim’s
MAX3100 SPI/Microwire UART. The chip converts between synchronous and
asynchronous serial data (Figure 11-2). The synchronous data is compatible
with SPI and Microwire, which require a clock line plus a data line for each
direction.
Free download pdf