S3C84E5/C84E9/P84E9 UART
13-1
13 UART
OVERVIEW
The UART block has a full-duplex serial port with programmable operating modes: There is one synchronous mode
and three UART (Universal Asynchronous Receiver/Transmitter) modes:
Shift Register I/O with baud rate of fxx/(16 × (16-bit BRDATA+1))
8-bit UART mode; variable baud rate, fxx/(16 × (16-bit BRDATA+1))
9-bit UART mode; variable baud rate, fxx/(16 × (16-bit BRDATA+1))
UART receive and transmit buffers are both accessed via the data register, UDATA, is at address F5H. Writing to the
UART data register loads the transmit buffer; reading the UART data register accesses a physically separate receive
buffer.
When accessing a receive data buffer (shift register), reception of the next byte can begin before the previously
received byte has been read from the receive register. However, if the first byte has not been read by the time the
next byte has been completely received, the first data byte will be lost (Overrun error).
In all operating modes, transmission is started when any instruction (usually a write operation) uses the UDATA
register as its destination address. In mode 0, serial data reception starts when the receive interrupt pending bit
(UARTPND.1) is "0" and the receive enable bit (UARTCON.4) is "1". In mode 1 and 2, reception starts whenever an
incoming start bit ("0") is received and the receive enable bit (UARTCON.4) is set to "1".
PROGRAMMING PROCEDURE
To program the UART modules, follow these basic steps:
1. Configure P1.4 and P1.5 to alternative function (RXD (P1.4), TXD (P1.5)) for UART module by setting the
P1CONL register to appropriatly value.
2. Load an 8-bit value to the UARTCON control register to properly configure the UART I/O module.
3. For parity generation and check in UART mode 2, set parity enable bit (UARTPND.5) to “1”.
4. For interrupt generation, set the UART interrupt enable bit (UARTCON.1 or UARTCON.0) to "1".
5. When you transmit data to the UART buffer, write transmit data to UDATA, the shift operation starts.
6. When the shift operation (transmit/receive) is completed, UART pending bit (UARTPND.1 or UARTPND.0) is set
to "1" and an UART interrupt request is generated.