S3CC40D/FC40D_UM_REV1.20
UART 2
27
UART 2
OVERVIEW
The UART 2 block has a full-duplex serial port with programmable operating modes: There is one synchronous
mode and three UART (Universal Asynchronous Receiver/Transmitter) 2 modes:
Serial I/O with baud rate of fxx/(16
× (BR2DATA+1))
8-bit UART mode; variable baud rate
9-bit UART mode; fxx/16
9-bit UART mode, variable baud rate
UART 2 receive and transmit buffers are both accessed via the data register, UART2DATA, is at address
3F00BAH. Writing to the UART 2 data register loads the transmit buffer; reading the UART 2 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
UART2DATA register as its destination address. In mode 0, serial data reception starts when the receive interrupt
bit (IRR12) is "1" and the receive enable bit (UART2CONH.4) is "1". In mode 1, 2, and 3, reception starts
whenever an incoming start bit ("0") is received and the receive enable bit (UART2CONH.4) is set to "1".
PROGRAMMING PROCEDURE
To program the UART 2 modules, follow these basic steps:
1.
Configure P8.2 and P8.3 to alternative function (RxD1 (P8.2), TxD1 (P8.3)) for UART module by setting the
P8CONL register to appropriately value.
2.
Load an 8-bit value to the UART2CONH/L control register to properly configure the UART I/O module.
3.
For interrupt generation, set the UART 2 I/O interrupt enable bit (IMR0L.3 or IMR0L.4) to "1".
4.
When you transmit data to the UART 2 buffer, write data to UART2DATA, the shift operation starts.
5.
When the shift operation (transmit/receive) is completed, UART 2 Receive Start Bit (UART2CONH.0) is set to
"1" and an UART 2 interrupt request is generated.
26-1