Epson S1C17M20 Technical Manual page 165

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

Receiving subsequent data
When the received data is read out from the I2CnRXD register after the I2CnINTF.RBFIF bit has been set to 1,
the I2C Ch.n clears the I2CnINTF.RBFIF bit to 0, releases SCL, and receives subsequent data sent from the
external master. After eight-bit data has been received, the I2C Ch.n sends an ACK and pulls down SCL to
low. The received data in the shift register is transferred to the receive data buffer and the I2CnINTF.RBFIF
and I2CnINTF.BYTEENDIF bits are both set to 1.
To return a NACK after eight-bit data is received, such as when terminating data reception, write 1 to the
I2CnCTL.TXNACK bit before the data reception is completed. The I2CnCTL.TXNACK bit is automati-
cally cleared to 0 after a NACK has been sent.
STOP/repeated START condition detection
It is the same as the data transmission in slave mode.
I
2
C bus
S
Saddr/W
BSY = 1
Software bit operations
Operations by the external master
S: START condition, Sr: Repeated START condition, P: STOP condition,
A: ACK, A: NACK, Saddr/W: Slave address + W(0), Data n: 8-bit data
Figure 14.4.6.1 Example of Data Receiving Operations in Slave Mode
S1C17M20/M21/M22/M23/M24/M25
TECHNICAL MANUAL (Rev. 1.0)
Clock stretching by I2C
STARTIF = 1
RXD[7:0]
A
Data 1
A
TR = 0
RBFIF = 1
STARTIF = 1
BYTEENDIF = 1
Hardware bit operations
Operations by I2C (slave mode)
Data reception
One-byte reception?
YES
Write 1 to the I2CnCTL.TXNACK bit
Wait for an interrupt request
(I2CnINTF.STARTIF = 1)
Write 1 to the I2CnINTF.STARTIF bit
Wait for an interrupt request
(I2CnINTF.RBFIF = 1)
Last data received next?
YES
Write 1 to the I2CnCTL.TXNACK bit
Read receive data from the I2CnRXD register
Last data received?
YES
End
Figure 14.4.6.2 Slave Mode Data Reception Flowchart
Seiko Epson Corporation
Data 1
RXD[7:0]
Data 2
A
Data N
RBFIF = 1
RBFIF = 1
BYTEENDIF = 1
BYTEENDIF = 1
TXNACK = 1
RXD[7:0]
A
Data N
RBFIF = 1
RBFIF = 1
BYTEENDIF = 1
BYTEENDIF = 1
NO
NO
NO
14 I
2
C (I2C)
Data (N -1) RXD[7:0]
Data N
A
P
BSY = 0
STOPIF = 1
Sr
Data (N -1) RXD[7:0]
Data N
A
P
BSY = 0
TXNACK = 0
STOPIF = 1
Sr
TXNACK = 0
14-13

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17m25S1c17m21S1c17m22S1c17m23S1c17m24

Table of Contents