16-13
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
bit to the R/W bit value in the received address. If this value is 1, the I2C Ch.
n
sets the I2C_
n
INTF.TBEIF
bit to 1 and starts data sending operations.
Sending the first data byte
After the valid slave address has been received, the I2C Ch.
n
pulls down SCL to low and enters
standby state until data is written to the I2C_
n
TXD register. This puts the I
2
C bus into clock
stretching state and the external master into standby state. When transmit data is written to the
I2C_
n
TXD register, the I2C Ch.
n
clears the I2C_
n
INTF.TBEIF bit and sends an ACK to the master.
The transmit data written in the I2C_
n
TXD register is automatically transferred to the shift register
and the I2C_
n
INTF.TBEIF bit is set to 1. The data bits in the shift register are output in sequence to
the I
2
C bus.
Sending subsequent data
If the I2C_
n
INTF.TBEIF bit = 1, subsequent transmit data can be written during data transmission.
If the I2C_
n
INTF.TBEIF bit is still set to 1 when the data transmission from the shift register has
completed, the I2C Ch.
n
pulls down SCL to low (sets the I
2
C bus into clock stretching state) until
transmit data is written to the I2C_
n
TXD register.
If the next transmit data already exists in the I2C_
n
TXD register or data has been written after
the above, the I2C Ch.
n
sends the subsequent eight-bit data when an ACK from the external master
is received. At the same time, the I2C_
n
INTF.BYTEENDIF bit is set to 1. If a NACK is received, the
I2C_
n
INTF.NACKIF bit is set to 1 without sending data.
STOP/repeated START condition detection
While the I2C_
n
CTL.MST bit = 0 (slave mode) and the I2C_
n
INTF.BSY = 1, the I2C Ch.
n
monitors the
I
2
C bus. When the I2C Ch.
n
detects a STOP condition, it terminates data sending operations. At
this time, the I2C_
n
INTF.BSY bit is cleared to 0 and the I2C_
n
INTF.STOPIF bit is set to 1. Also when the
I2C Ch.
n
detects a repeated START condition, it terminates data sending operations. In this case, the
I2C_
n
INTF.STARTIF bit is set to 1.
Figure 16.4.5.1 Example of Data Sending Operations in Slave Mode
Figure 16.4.5.2 Slave Mode Data Transmission Flowchart
S: START condition, Sr: Repeated START condition, P: STOP condition,
A: ACK, A: NACK, Saddr/R: Slave a R(1), Saddr/W: Slave a W(0),
Data n: 8-bit data
Software bit operations
Operations by I2C (master mode)
Operations by the external slave
Hardware bit operations
A
TBEIF = 1
Data 1
P
BSY = 0
STOPIF = 1
A
S
Saddr/R
TBEIF = 1
BYTEENDIF = 1
A
TBEIF = 1
BYTEENDIF = 1
A
Data 2
Data 3
NACKIF = 1
BYTEENDIF = 1
Sr
BSY = 1
STARTIF = 1
TBEIF = 1
Saddr/R
Sr
TR = 0
BSY = 1
STARTIF = 1
Saddr/W
Data 1
→
TXD[7:0]
Data 2
→
TXD[7:0]
Data 3
→
TXD[7:0]
Data N
→
TXD[7:0]
TR = 1
STARTIF = 1
TBEIF = 1
BSY = 1
I
2
C bus
Clock stretching by I2C
Data transmission
continued
Data reception
starts
Data transmission
End
I2C_
n
INTF.NACKIF = 1 ?
Write data to the I2C_
n
TXD register
Wait for an interrupt request
(I2C_
n
INTF.TBEIF = 1 or I2C_
n
INTF.NACKIF = 1)
No
Yes
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...