20 i
2
C MaSTeR (i2CM)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
20-3
SDA0 (output)
SCL0 (output)
Start condition
5.1 Start Condition
Figure 20.
The start condition is generated by setting STRT/I2CM_CTL register to 1.
STRT is automatically reset to 0 once the start condition is generated. The I
2
C bus is busy from this point on.
(2) Slave address transmission
Once the start condition has been generated, the I
2
C master (this module) sends a bit indicating the slave address
and transfer direction for communications. I
2
C slave addresses are either 7-bit or 10-bit. This module uses an
8-bit transfer data register to send the slave address and transfer direction bit, enabling single transfers in 7-bit
address mode. In 10-bit mode, data is sent twice or three times under software control. Figure 20.5.2 shows the
configuration of the address data.
Slave address
7-bit address
Transfer direction
0: master
→
slave (transmission)
1: slave
→
master (reception)
A6
A5
D7
D6
A4
D5
A3
D4
A2
D3
A1
D2
A0
D1
DIR
D0
8 low order slave address bits
A7
A6
D7
D6
A5
D5
A4
D4
A3
D3
A2
D2
A1
D1
A0
D0
2 high order
slave address bits
10-bit address
1
First transmit data
Second transmit data
Third transmit data
1
D7
D6
1
D5
1
D4
0
D3
A9
D2
A8
D1
0
D0
1
1
D7
D6
1
D5
1
D4
0
D3
A9
D2
A8
D1
1
D0
(When receiving data)
Issue a repeated start condition after the second data has been sent and then send the third data as shown below.
2 high order
slave address bits
5.2 Transmit Data Specifying Slave Address and Transfer Direction
Figure 20.
The transfer direction bit indicates the data transfer direction after the slave address has been sent. This is set to
0 when sending data from the master to the slave and to 1 when receiving data from the slave. To send a slave
address, set the address with the transfer direction bit to RTDT[7:0]/I2CM_DAT register. At the same time, set
TXE/I2CM_DAT register transmitting the address to 1.
After the slave address has been output, data can be sent and received as many times as required. Data must be
sent or received according to the transfer direction set together with the slave address.
Data transmission control
The procedure for transmitting data is described below. Data transmission is performed by the same procedure
as for slave address transmission.
To send byte data, set the transmit data to RTDT[7:0] and set TXE to 1 to transmit 1 byte.
When TXE is set to 1, the I2CM module begins data transmission in sync with the clock. If the previous data
is currently being transmitted, data transmission starts after this has been completed. The I2CM module first
transfers the data written to the shift register, then starts outputting the clock from the SCL0 pin. TXE is reset to
0 at this point and a cause of interrupt occurs, enabling the subsequent transmission data and TXE to be set.
The data bits in the shift register are shifted in sequence at the clock falling edge and output via the SDA0 pin
with the MSB leading. The I2CM module outputs 9 clocks with each data transmission. In the 9th clock cycle,
the I2CM module sets the SDA line into high impedance to receive an ACK or NAK sent from the slave device.