
13-6
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
13.5.
Operations
13.5.1.
Initialization
The UART3 Ch.
n
should be initialized with the procedure shown below.
1.
Assign the UART3 Ch.
n
input/output function to the ports. (Refer to the “I/O Ports” chapte
r.)
2.
Set the UART3_
n
CLK.CLKSRC[1:0] and UART3_
n
CLK.CLKDIV[1:0] bits. (Configure operating clock)
3.
Configure the following UART3_
n
MOD register bits:
-
UART3_
n
MOD.BRDIV bit (Select baud rate division ratio (1/16 or 1/4))
-
UART3_nMOD.INVRX bit (Enable/disable USIN
n
input signal inversion)
-
UART3_nMOD.INVTX bit (Enable/disable USOUT
n
output signal inversion)
-
UART3_
n
MOD.PUEN bit (Enable/disable USIN
n
pin pull-up)
-
UART3_
n
MOD.OUTMD bit (Enable/disable USOUT
n
pin open-drain output)
-
UART3_
n
MOD.IRMD bit (Enable/disable IrDA interface)
-
UART3_
n
MOD.CHLN bit (Set data length (7 or 8 bits))
-
UART3_
n
MOD.PREN bit
(Enable/disable parity function)
-
UART3_
n
MOD.PRMD bit (Select parity mode (even or odd))
-
UART3_
n
MOD.STPB bit
(Set stop bit length (1 or 2 bits))
-
UART3_
n
MOD.CAREN bit (Enable/disable carrier modulation function)
-
UART3_nMOD.PECAR bit (Select carrier modulation period (H data period/L data period))
4.
Set the UART3_
n
BR.BRT[7:0] and UART3_
n
BR.FMD[3:0] bits.
(Set transfer rate)
5.
Set the UART3_
n
CAWF.CRPER[7:0] bits. (Set carrier cycle)
6.
Set the following UART3_
n
CTL register bits:
-
Set the UART3_
n
CTL.SFTRST bit to 1.
(Execute software reset)
-
Set the UART3_
n
CTL.MODEN bit to 1.
(Enable UART3 Ch.
n
operations)
7.
Set the following bits when using the interrupt:
-
Write 1 to the interrupt flags in the UART3_
n
INTF register.
(Clear interrupt flags)
-
Set the interrupt enable bits in the UART3_
n
INTE register to 1. * (Enable interrupts)
*The initial value of the UART3_nINTF.TBEIF bit is 1, therefore, an interrupt will occur immediately after
the UART3_nINTE.TBEIE bit is set to 1.
8.
Configure the DMA controller and set the following UART3 control bits when using DMA transfer:
-
Write 1 to the DMA transfer request enable bits in theUART3_
n
TBEDMAEN and
UART3_
n
RB1FDMAEN registers. (Enable DMA transfer requests)
13.5.2.
Data Transmission
A data sending procedure and the UART3 Ch.
n
operations are shown below. Figures 13.5.2.1 and
13.5.2.2 show a timing chart and a flowchart, respectively.
Data sending procedure
1.
Check to see if the UART3_
n
INTF.TBEIF bit is set to 1 (transmit buffer empty).
2.
Write transmit data to the UART3_
n
TXD register.
3.
Wait for a UART3 interrupt when using the interrupt.
4.
Repeat Steps 1 to 3 (or 1 and 2) until the end of transmit data.
UART3 data sending operations
The UART3 Ch.
n
starts data sending operations when transmit data is written to the UART3_
n
TXD
register. The transmit data in the UART3_
n
TXD register is automatically transferred to the shift
register and the UART3_
n
INTF.TBEIF bit is set to 1 (transmit buffer empty).
The USOUT
n
pin outputs a start bit and the UART3_
n
INTF.TBSY bit is set to 1 (transmit busy). The shift
register data bits are then output successively from the LSB. Following output of MSB, the parity bit (if
parity is enabled) and the stop bit are output.
Even if transmit data is being output from the USOUT
n
pin, the next transmit data can be written
to the UART3_
n
TXD register after making sure the UART3_
n
INTF.TBEIF bit is set to 1.
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...