12 I
2
C (I2C)
12-6
Seiko epson Corporation
S1C17F13 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
4.2.1 Example of Data Sending Operations in Master Mode
Figure 12.
Data transmission
End
Write slave address and WRITE (0) to
the I2C
n
TXD register
Write 1 to the I2C
n
CTL.TXSTOP bit
Write 1 to the I2C
n
CTL.TXSTART bit
YES
NO
YES
YES
NO
Last data sent?
I2C
n
INTF.NACKIF = 1 ?
No
Retry?
Write data to the I2C
n
TXD register
Wait for an interrupt request
(I2C
n
INTF.TBEIF = 1)
Wait for an interrupt request
(I2C
n
INTF.STOPIF = 1)
Wait for an interrupt request
(I2C
n
INTF.TBEIF = 1 or I2C
n
INTF.NACKIF = 1)
4.2.2 Master Mode Data Transmission Flowchart
Figure 12.