18 uaRT
18-2
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
uaRT input/Output Pins
18.2
Table 18.2.1 lists the UART input/output pins.
2.1 List of UART Pins
Table 18.
Pin name
i/O
Qty
Function
SIN0 (Ch.0)
SIN1 (Ch.1)
I
2
UART Ch.
x
data input pin
Inputs serial data sent from an external serial device.
SOUT0 (Ch.0)
SOUT1 (Ch.1)
O
2
UART Ch.
x
data output pin
Outputs serial data sent to an external serial device.
SCLK0 (Ch.0)
SCLK1 (Ch.1)
I
2
UART Ch.
x
clock input pin
Inputs the transfer clock when an external clock is used.
The UART input/output pins (SIN
x
, SOUT
x
, SCLK
x
) are shared with I/O ports and are initially set as general pur-
pose I/O port pins. The pin functions must be switched using the port function select bits to use the general purpose
I/O port pins as UART input/output pins.
For detailed information on pin function switching, see the “I/O Ports (P)” chapter.
Transfer Clock
18.3
Either the internal clock or an external clock can be selected as the UART transfer clock using SSCK/UART_
MOD
x
register.
note: Make sure that the UART is halted (RXEN/UART_CTL
x
register = 0) before altering SSCK.
internal clock
Setting SSCK to 0 (default) selects the internal clock. UART Ch.0 uses the T8F Ch.0 output clock as the trans-
fer clock, while UART Ch.1 uses the T8F Ch.1 output clock. Thus, T8F must be programmed to output a clock
suited to the transfer rate.
For more information on T8F control, see the “Fine Mode 8-bit Timers (T8F)” chapter.
external clock
Setting SSCK to 1 selects an external clock. In this case, input an external clock from the SCLK
x
pin.
notes: • The UART generates a sampling clock by dividing the T8F output or the external clock by 16.
Take this into consideration when setting the transfer rate.
• When supplying an external clock via the SCLK
x
pin, the clock frequency must be less than
half of the PCLK with a duty ratio of 50%.
Transfer Data Settings
18.4
Set the following conditions to configure the transfer data format.
• Data length: 7 or 8 bits
• Start bit:
Fixed at 1 bit
• Stop bit:
1 or 2 bits
• Parity bit: Even, odd, or no parity
note: Make sure the UART is halted (RXEN/UART_CTL
x
register = 0) before changing transfer data
format settings.
Data length
The data length is selected by CHLN/UART_MOD
x
register. Setting CHLN to 0 (default) configures the data
length to 7 bits. Setting CHLN to 1 configures it to 8 bits.