16 I
2
C (I2C)
16-8
Seiko Epson Corporation
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
Data receiving operations
Generating a START condition
It is the same as the data transmission in master mode.
Sending slave address
It is the same as the data transmission in master mode. Note, however, that the I2C_
n
TXD.TXD0 bit must
be set to 1 that represents READ as the data transfer direction to issue a request to the slave to send data.
Receiving data
After the slave address has been sent, the slave device sends an ACK and the first data. The I2C Ch.
n
sets
the I2C_
n
INTF.RBFIF bit to 1 after the data reception has completed. Furthermore, the I2C Ch.
n
returns
an ACK. To return a NACK, such as for a response after the last data has been received, write 1 to the I2C_
n
CTL.TXNACK bit before the I2C_
n
INTF.RBFIF bit is set to 1.
The received data can be read out from the I2C_
n
RXD register after a receive buffer full interrupt has oc-
curred. The I2C Ch.
n
pulls down SCL to low and enters standby state until data is read out from the I2C_
n
RXD register.
This reading triggers the I2C Ch.
n
to start subsequent data reception.
Generating a STOP or repeated START condition
It is the same as the data transmission in master mode.
S
S
P
A
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
NACKIF = 1
TXSTART = 1
TXSTOP = 1
RXD[7:0]
→
Data N
TXSTART = 1
RXD[7:0]
→
Data N
TXSTART = 1
TXSTOP = 1
RXD[7:0]
→
Data N
TXSTOP = 1
Saddr/R
→
TXD[7:0]
RXD[7:0]
→
Data 1
TXNACK = 1
RXD[7:0]
→
Data (N-1)
RBFIF = 1
RBFIF = 1
TXSTOP = 0
STOPIF = 1
TXSTOP = 0
STOPIF = 1
Saddr/R
A
Data 1
A
Data 2
A
Data N
P
A
I
2
C bus
A
A
NACKIF = 1
TXSTART = 1
TXSTOP = 1
TXSTOP = 0
STOPIF = 1
P
A
NACKIF = 1
TXSTART = 1
Sr
A
S
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTOP = 0
STOPIF = 1
P
Sr
Software bit operations
Operations by I2C (master mode)
S: START condition, Sr: Repeated START condition, P: STOP condition,
A: ACK, A: NACK, Saddr/R: Slave a R(1), Data n: 8-bit data
Hardware bit operations
Operations by the external slave
Standby state (SCL = low)
RBFIF = 1
TXNACK = 0
RBFIF = 1
TXNACK = 0
RBFIF = 1
TXNACK = 0
Figure 16.4.3.1 Example of Data Receiving Operations in Master Mode