Using the UART interfaces in the SPEAr embedded MPU family
Introduction
The SPEAr embedded MPU family is a family of configurable MPUs, based on the ARM926
CPU core. Each member of the SPEAr MPU family has one or more embedded ARM PL011
UARTs for asynchronous communications. This application note describes how to configure
the UART and transmit and receive data.
A Linux driver is available in the SPEAr Linux support package (LSP), refer to the SPEAR
Linux support package (LSP) user manual (UM0851) for a description of how to use this
driver.
Section 10 of this application note describes an OS independent hardware abstraction layer
(HAL) for the SPEAr UART which you can use as a starting point for developing your own
HAL code.
UART is one of the most commonly used serial interface peripherals. It is also known as the
serial communications interface, or SCI. The most common use of the UART is to
communicate to a PC serial port using the RS-232 protocol.
RS-232 is a standard electrical interface for serial communications defined by the Electronic
Industries Association ("EIA").
Serial communications include most network devices, keyboards, mice, modems, and
terminals. When referring to serial devices or ports, they are either labeled as data
communications equipment ("DCE") or data terminal equipment ("DTE").
The UART can transmit and receive data serially. It is often necessary to regulate the flow of
data when transferring data between two serial interfaces. The first method is often called
"software" flow control and uses special characters to start (XON or DC1) or stop (XOFF or
DC3) the flow of data. The second method is called "hardware" flow control and uses the
RS-232 CTS and RTS signals instead of special characters. Because hardware flow control
uses a separate set of signals, it is much faster than software flow control which needs to
send or receive multiple bits of information to do the same thing.
4/30Doc ID 16862 Rev 2
AN3123UART signals
2 UART signals
SPEAr600 has 2 UARTs. SPEAr300, SPEAr310 and SPEAr320 have 1, 6 and 3 UARTs
respectively. The following tables list the UART pin connections and register base addresses
for each case.
2.1 SPEAr600
Table 1.External pin connection on SPEAr600
Signal nameBallDirectionFunctionPin type
UART1_TXDAA19Output
UART1_RXDAB19Input
Table 2.Memory map on SPEAr600
PeripheralStart addressEnd address
UART10xD000.00000xD007.FFFF
UART20xD008.00000xD00F.FFFF
2.2 SPEAr300
Table 3.External pin connection
SignalBallDirectionFunctionPin type
RX DATAD1Input
TX DATAE4Output
RTSB8
CTSA8
DTRD9
DSRB9
I/O
Serial Data Out
Serial Data In
Shared I/O
TTL output buffer
3.3 V capable, 4 mAUART2_TXDAA20Output
TTL input buffer
3.3 V tolerant, PDUART2_RXDAB20Input
TTL output buffer
3.3 V capable,
up to 10 mA
TTL input buffer
3.3 V tolerant, PU/PD
DCDA9
RIC9
Table 4.Memory map on SPEAr300
PeripheralStart addressEnd address
UART0xD000.00000xD007.FFFF
Doc ID 16862 Rev 25/30
UART signalsAN3123
In SPEAr300, the device offers several different PL_GPIO sharing modes. Different
blocks/IPs are available in different configuration modes.
This has an effect on the above mentioned UART signals also. Not all SPEAR300 UART
signals in Ta bl e 3 are available in all configurations.
This is because for many applications UART is used in NULL modem mode and only
UART_RX & UART_TX are sufficient.
There are 13 possible UART configurations in SPEAr300 which can be selected by RAS
control register 2.
In configuration 1 & configuration 2, the UART with modem control lines is available.
In configurations 3 to 13, the UART without modem control lines is available (see Tab le 6 ).
Table 5.UART configurations for SPEAr300
SignalConfiguration 1Configuration 2Configurations 3 to 13
PL_GPIO[42]UART_DTRUART_DTR-
PL_GPIO[41]UART_RIUART_RI-
PL_GPIO[40]UART_DSRUART_DSR-
PL_GPIO[39]UART_DCDUART_DCD-
PL_GPIO[38]UART_CTSUART_CTS-
PL_GPIO[37]UART_RTSUART_RTS-
PL_GPIO[3]UART_RXUART_RXUART_RX
PL_GPIO[2]UART_TXUART_TXUART_TX
Note:On PL_GPIO[3] and PL_GPIO[2] UART_RX and UART_TX are multiplexed with external
memory controller (FSMC) signals /E3 and /E4 respectively.
2.3 SPEAr310
In SPEAr310 the external pin connections of UART1 are the same as in SPEAr300.
You can configure the device to have either
●up to 6 UARTs without modem control lines or
●1 UART with modem control lines.
Refer to Ta bl e 3 .
6/30Doc ID 16862 Rev 2
AN3123UART signals
Table 6.UART configurations for SPEAr310
SignalBallAlternate functionRAS normal modePin type
PL_GPIO[44]A10-UART5_TX
PL_GPIO[43]E9-UART5_RX
PL_GPIO[42]D9UART0_DTRUART5_TX
PL_GPIO[41]C9UART0_RIUART5_RX
PL_GPIO[40]B9UART0_DSRUART4_TX
PL_GPIO[39]A9UART0_DCDUART4_RX
PL_GPIO[38]A8UART0_CTSUART3_TX
PL_GPIO[37]B8UART0_RTSUART3_RX
PL_GPIO[3]D1UART0_RXUART0_RX
PL_GPIO[2]E4UART0_TXUART0_TX
PL_GPIO[1]E3UART1_TX
PL_GPIO[0]F3UART1_RX
Table 7.Memory map on SPEAr310
PeripheralStart addressEnd address
TTL output buffer
3.3 V capable,
up to 10 mA
TTL input buffer
3.3 V tolerant, PU/PD
UART10xD000.00000xD007.FFFF
UART20xB200.00000xB207.FFFF
UART30xB208.00000xB20F.FFFF
UART40xB210.00000xB217.FFFF
UART50xB218.00000xB21F.FFFF
UART60xB220.00000xB227.FFFF
2.4 SPEAr320
In SPEAr320 the external pin connections of UART0 are the same as the UART in
SPEAr300. Refer to Ta bl e 3 .
You can configure the device to have:
●up to 3 UARTs, 1 without modem control lines and 2 with modem control lines.
Table 8.UART configurations for SPEAr320
SignalBallAlternate
PL_GPIO[45]B10UART1_DCD
PL_GPIO[44]A10-UART1_DSR
Config. 1 Config. 2Config. 3Config. 4
function
PL_GPIO[43]E9-UART1_RTS
Doc ID 16862 Rev 27/30
UART signalsAN3123
Table 8.UART configurations for SPEAr320 (continued)