Hardware Reference
In-Depth Information
Data Flow
Physical Port
DB-9 or DB-25
Logic-Level Shifter
function
UART
function
Shift Register
function
Data Source (PC)
Figure 9-1. A high-level view of the ICs and steps involved in a serial port
Of course, there is a lot more to the serial port than what you see in Figure 9-1 but it should give you a general idea.
There are two well-known generic UART ICs:
The National Semiconductor 8250 was a very early UART IC that was in most PCs during the
1980s. This chip was a little slow but was simple to implement.
One of the main clones of the 8250 was the 16550. The 16550 was originally made by National
Semiconductor as well, and it improved on the 8250 but still remained easy to implement. The
16550 gained widespread adoption and can still be found on devices today. Because of this,
the 16550 became the main standard for a UART implementation.
Today you will often read about a UART being compliant with the 16550. This means that all the functions that
were defined as part of a 16550 IC would still function exactly the same on the computable IC. If you were to look
at the data sheets of a 16550 compared to a 16550 compatible, you should notice a lot of similarities.
Serially a Bit of a Letdown
Getting back to the Raspberry Pi, everything but the physical interface and the logic-level shifter functions are already
on board. The Raspberry Pi provides you with two UARTs for your use via the GPIO pins. Both UARTs are provided
by the Broadcom system on chip (SoC) and are commonly known as the PL011 UART and the mini UART. By default,
GPIOs 14 and 15 are set up on boot as the PL011 UART port (also known as UART0). This UART is what I will use
throughout this chapter. The second UART (also known as the mini UART or UART1) is not a fully compliant UART
port. The mini UART cannot provide the following functionality:
Break detection
Framing errors detection
Parity bit
Time-out interrupt
Data Carrier Detect (DCD), Data Set Ready (DSR), Data Terminal Ready (DTR) , or Ring
Indicator (RI) signals
In addition to this missing functionality, UART1 is also mapped to the exact same GPIO pin headers as UART0.
I cannot see any benefit in using UART1 over UART0. As such, I won't use it at all. Let's move back to UART0; this
UART is nearly complete in terms of functionality but the following features are missing:
Infrared data association (IRDA)
Serial infrared (SIR) protocol encoder/decoder (ENDEC)
Direct memory access (DMA)
That should not be too much of an issue unless you're looking at using infrared devices on your UART port.
 
 
Search WWH ::




Custom Search