18 UNIVERSAL SERIAL INTERFACE (USI)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
18-5
Settings for UART Mode
18.4.4
When the USI is used in UART mode, configure the data length, stop bit, and parity bit. The start bit length is fixed
at 1 bit.
Data length
Use UCHLN/USI_UCFG register to select the data length. Setting UCHLN to 0 (default) configures the data
length to 7 bits. Setting UCHLN to 1 configures it to 8 bits.
Stop bit
Use USTPB/USI_UCFG register to select the stop bit length. Setting USTPB to 0 (default) configures the stop
bit length to 1 bit. Setting USTPB to 1 configures it to 2 bits.
Parity bit
Use UPREN/USI_UCFG register to select whether the parity function is enabled or not. Setting UPREN to 0
(default) disables the parity function. In this case, no parity bit will be added to transfer data and receive data
will not be checked for parity. Setting UPREN to 1 enables the parity function. In this case, a parity bit will be
added to transfer data and receive data will be checked for parity.
When the parity function is enabled, the parity mode should be selected using UPMD/USI_UCFG register. Set-
ting UPMD to 0 (default) adds a parity bit and checks for odd parity. Setting UPMD to 1 adds a parity bit and
checks for even parity.
Sampling clock
UCHLN = 0, UPREN = 0, USTPB = 0
UCHLN = 0, UPREN = 1, USTPB = 0
UCHLN = 0, UPREN = 0, USTPB = 1
UCHLN = 0, UPREN = 1, USTPB = 1
UCHLN = 1, UPREN = 0, USTPB = 0
UCHLN = 1, UPREN = 1, USTPB = 0
UCHLN = 1, UPREN = 0, USTPB = 1
UCHLN = 1, UPREN = 1, USTPB = 1
s1
D0
D1
D2
D3
D4
D5
D6
s2
s1
D0
D1
D2
D3
D4
D5
D6
p
s2
s1
D0
D1
D2
D3
D4
D5
D6
s2
s3
s1
D0
D1
D2
D3
D4
D5
D6
p
s2
s3
s1
D0
D1
D2
D3
D4
D5
D6
D7
s2
s1
D0
D1
D2
D3
D4
D5
D6
D7
p
s2
s1
D0
D1
D2
D3
D4
D5
D6
D7
s2
s3
s1
D0
D1
D2
D3
D4
D5
D6
D7
p
s2
s3
s1: start bit, s2 & s3: stop bit, p: parity bit
4.4.1 Transfer Data Format in UART Mode (LSB first)
Figure 18.
Settings for SPI Mode
18.4.5
When the USI is used in SPI mode (master or slave), configure the SPI clock polarity/phase. When used in SPI
master mode, select the clock mode and data length.
Note that the data length in SPI slave mode is fixed at 8 bits.
SPI clock polarity and phase settings (master mode and slave mode)
Use SCPOL/USI_SCFG register to select the SPI clock polarity. Setting SCPOL to 1 treats the SPI clock as ac-
tive low. Setting it to 0 (default) treats it as active high.
The SPI clock phase can be selected using SCPHA/USI_SCFG register.
These control bits set transfer timing as shown in Figure 18.4.5.1.