18 UNIVERSAL SERIAL INTERFACE (USI)
18-4
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
The T8 output clock frequency (f
SOURCE
) must be set so that the conditions shown below are satis-
fied.
f
SOURCE
> 3/Tbc
f
SOURCE
> 4/Tce
Be aware that the actual SCL signal will be delayed, as the I
2
C slave forcibly drives the SCL line
to low. The figure below shows an example in which the timing becomes worse.
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
3.2 Example of Delayed I
Figure 18.
2
C Clock
USI Module Settings
18.4
Make the following settings before starting data transfers using the USI module.
(1) Program the clock source module to supply the clock required to the USI module. (See Section 18.3.)
(2) Reset the USI module.
(3) Set the USI interface mode and a general condition (MSB first/LSB first) to be applied to all interface modes.
(4) Set the data format and operating conditions for the interface mode selected.
(5) Set interrupt and DMA transfer conditions if necessary. (See Section 18.7.)
(6) Select the port functions to be used for USI according to the interface mode. (See Section 18.2 and the “I/O
Ports (GPIO)” chapter.)
USI Module Software Reset
18.4.1
Writing 0x0 to USIMOD[2:0]/USI_GCFG register resets the USI module circuits. Be sure to perform software re-
set before setting the interface mode.
Interface Mode
18.4.2
The USI module provides five serial interface functions shown in Section 18.1. Each channel can be configured to
one of them using the USIMOD[2:0]/USI_GCFG register.
4.2.1 Interface Mode Selection
Table 18.
USIMOD[2:0]
Interface mode
0x5
I
2
C slave
0x4
I
2
C master
0x3
SPI slave
0x2
SPI master
0x1
UART
0x0
Software reset
(Default: 0x0)
Note: Be sure to perform software reset and set the interface mode before changing other USI configu-
rations.
General Settings for All Interface Modes
18.4.3
MSB first/LSB first selection
Use LSBFST/USI_GCFG register to select whether the data MSB or LSB is input/output first.
LSB first is selected when LSBFST is set to 0 (default). MSB first is selected when LSBFST is set to 1.