S3C825A/P825A
UART
18-1
18
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:
— Serial I/O with baud rate of fxx/(16
× (BRDATA+1))
— 8-bit UART mode; variable baud rate
— 9-bit UART mode; fxx/16
— 9-bit UART mode, variable baud rate
UART receive and transmit buffers are both accessed via the data register, UDATA, is set 1, bank 0 at address
F9H. 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, one of the bytes will be lost.
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
(INTPND.5) is "0" and the receive enable bit (UARTCON.4) is "1". In mode 1, 2, and 3, 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 P5.4 and P5.5 to alternative function (RxD (P5.4), TxD (P5.5)) for UART module by setting the
P5CONH 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 interrupt generation, set the UART I/O interrupt enable bit (UARTCON.1 or UARTCON.0) to "1".
4.
When you transmit data to the UART buffer, write data to UDATA, the shift operation starts.
5.
When the shift operation (transmit/receive) is completed, UART pending bit (INTPND.4 or INTPND.5) is set
to "1" and an UART interrupt request is generated.