14 I
2
C (I2C)
14-6
Seiko Epson Corporation
S1C17M20/M21/M22/M23/M24/M25
TECHNICAL MANUAL (Rev. 1.0)
S
S
P
A
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
TBEIF = 1
TBEIF = 1
TXSTART = 1
TXSTOP = 1
TXSTOP = 1
Saddr/W
→
TXD[7:0]
Data 1
→
TXD[7:0]
Data 2
→
TXD[7:0]
Data N
→
TXD[7:0]
TBEIF = 1
TBEIF = 1
TXSTOP = 0
STOPIF = 1
TXSTOP = 0
STOPIF = 1
Saddr/W
A
Data 1
A
Data 2
A
Data N
P
A
I
2
C bus
Software bit operations
Operations by I2C (master mode)
S: START condition, Sr: Repeated START condition, P: STOP condition,
A: ACK, A: NACK, Saddr/W: Slave a W(0), Data n: 8-bit data
Hardware bit operations
Operations by the external slave
Standby state (SCL = low)
TXSTART = 1
TXSTOP = 1
TXSTOP = 0
STOPIF = 1
P
A
TXSTART = 1
Sr
A
S
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
TXSTART = 1
TXSTOP = 1
TXSTOP = 0
STOPIF = 1
P
A
TXSTART = 1
Sr
A
TBEIF = 1
TBEIF = 1
NACKIF = 1
NACKIF = 1
NACKIF = 1
Figure 14.4.2.1 Example of Data Sending Operations in Master Mode
Data transmission
End
Write slave address and WRITE (0) to
the I2CnTXD register
Write 1 to the I2CnCTL.TXSTOP bit
Write 1 to the I2CnCTL.TXSTART bit
YES
NO
YES
YES
NO
Last data sent?
I2CnINTF.NACKIF = 1 ?
No
Retry?
Write data to the I2CnTXD register
Wait for an interrupt request
(I2CnINTF.TBEIF = 1)
Wait for an interrupt request
(I2CnINTF.STOPIF = 1)
Wait for an interrupt request
(I2CnINTF.TBEIF = 1 or I2CnINTF.NACKIF = 1)
Figure 14.4.2.2 Master Mode Data Transmission Flowchart