18 UNIVERSAL SERIAL INTERFACE (USI)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
18-3
When the USI is configured to an SPI slave or I
2
C slave device, the transfer clock is supplied from the external
master device. However, SPI slave mode uses PCLK1 and I
2
C slave mode uses the T8 Ch.0 output clock to
generate the sampling signal.
3.1 USI Clocks
Table 18.
Clock
Interface mode
Clock source
Operating clock
UART
PCLK1
SPI master
PCLK1
SPI slave
PCLK1
I
2
C master
PCLK1
I
2
C slave
PCLK1
Transfer/sampling
clock source
(division ratio in USI)
UART
T8 Ch.0 (f
SOURCE
/8)
SPI master
Normal mode: T8 Ch.0 (f
SOURCE
/2)
Fast mode:
PCLK1 (f
PCLK1
)
SPI slave
PCLK1 (f
PCLK1
/4) for sampling
I
2
C master
T8 Ch.0 (f
SOURCE
/8)
I
2
C slave
T8 Ch.0 (f
SOURCE
) for sampling
UART mode, I
2
C master mode
bps = f
SYS_CLK
×
DF / {(TR + 1)
×
8 + TFMD}
TR = (f
SYS_CLK
×
DF / bps - TFMD - 8) / 8
SPI master mode
bps = f
SYS_CLK
×
DF / {(TR + 1)
×
2 + TFMD}
TR = (f
SYS_CLK
×
DF / bps - TFMD - 2) / 2
f
SOURCE
: T8 Ch.0 output clock frequency [Hz]
f
SYS_CLK
: System clock frequency [Hz]
bps:
Transfer rate [bps]
DF:
Division ratio set by DF[3:0]/T8_CLK0 register (T8 Ch.0)
TR:
Reload data to be set to the T8_TR0 register (T8 Ch.0)
TFMD: Fine mode set value at TFMD[3:0]/T8_CTL0 register (T8 Ch.0)
Example: UART mode, transfer rate = 115,200 bps, system clock = 33 MHz, DF[3:0]/T8_CLK0 register setting
(T8 Ch.0) = 1/1, TFMD[3:0]/T8_CTL0 register setting (T8 Ch.0) = 14
TR = (33,000,000
×
1 / 115,200 - 14 - 8) / 8 = 33.05 (= 0x21)
For more information on controlling the T8 module, refer to the “8-bit Timers (T8)” chapter.
Note: When the USI is set to I
2
C slave mode, i2c_sck (I
2
C clock) is supplied from the external I
2
C mas-
ter. The T8 output clock frequency (f
SOURCE
) should be determined according to the i2c_sck fre-
quency.
T8 output clock
SCL controlled by I
2
C master
SCL controlled by I
2
C slave
USI_CK pin
a b
c
d e f
3.1 I
Figure 18.
2
C Clock in I
2
C Slave Mode
Tbf = Ti2c_baud_rate
Tbc = Ti2c_baud_rate_high
Tcf = Ti2c_baud_rate_low
Tce: The I
2
C master occupies the SCL line by driving it to low.
Tac: The I
2
C master releases the SCL line.
Tdf: In order to finish the internal operations, the I
2
C slave occupies the SCL line for two
source clock (T8 output clock) cycles by driving it to low after detecting that the I
2
C mas-
ter drives the SCL line to low.