Data Transmission In Slave Mode - Epson S1C17F13 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

12 I
2
C (I2C)
At start of data transmission
Standby state (SCL = low)
TXSTART = 1
1stAddr/W
I
2
C bus
S
1stAddr/W
TXSTART = 0
STARTIF = 1
TBEIF = 1
At start of data reception
Standby state (SCL = low)
TXSTART = 1
1stAddr/W
2
S
1stAddr/W
I
C bus
TXSTART = 0
STARTIF = 1
TBEIF = 1
Figure 12.
4.4.2 Example of Data Transfer Starting Operations in 10-bit Address Mode (Master Mode)
12.4.5

Data Transmission in Slave Mode

A data sending procedure in slave mode and the I2C Ch.n operations are shown below. Figures 12.4.5.1 and 12.4.5.2
show an operation example and a flowchart, respectively.
Data sending procedure
1. Wait for a START condition interrupt (I2CnINTF.STARTIF bit = 1).
Clear the I2CnINTF.STARTIF bit by writing 1 after the interrupt has occurred.
2. Check to see if the I2CnINTF.TR bit = 1 (transmission mode).
(Start a data receiving procedure if the I2CnINTF.TR bit = 0.)
3. Write transmit data to the I2CnTXD register.
4. Wait for a transmit buffer empty interrupt (I2CnINTF.TBEIF bit = 1), a NACK reception interrupt (I2Cn-
INTF.NACKIF bit = 1), or a STOP condition interrupt (I2CnINTF.STOPIF bit = 1).
i. Go to Step 3 when a transmit buffer empty interrupt has occurred.
ii. Go to Step 5 after clearing the I2CnINTF.NACKIF bit when a NACK reception interrupt has occurred.
iii. Go to Step 6 when a STOP condition interrupt has occurred.
5. Wait for a STOP condition interrupt (I2CnINTF.STOPIF bit = 1) or a START condition interrupt (I2CnINTF.
STARTIF bit = 1).
i. Go to Step 6 when a STOP condition interrupt has occurred.
ii. Go to Step 2 when a START condition interrupt has occurred.
6. Clear the I2CnINTF.STOPIF bit and then terminate data sending operations.
12-10
TXD[7:0]
2ndAddr
TXD[7:0]
Data 1
A
2ndAddr
A
TBEIF = 1
TBEIF = 1
TXD[7:0]
2ndAddr
TXD[7:0]
TXSTART = 1
A
2ndAddr
A
TBEIF = 1
TBEIF = 1
Software bit operations
Operations by I2C (master mode)
S: START condition, Sr: Repeated START condition, P: STOP condition,
A: ACK, A: NACK, 1stAddr/W: 1st address + W(0), 1stAddr/R: 1st address + R(1),
2ndAddr: 2nd address, Data n: 8-bit data
Seiko epson Corporation
TXD[7:0]
Data 1
A
TBEIF = 1
1stAddr/R
TXD[7:0]
Sr
1stAddr/R
A
Data 1
TXSTART = 0
STARTIF = 1
TBEIF = 1
Hardware bit operations
Operations by the external slave
RXD[7:0]
Data 1
A
Data 2
A
RBFIF = 1
RBFIF = 1
S1C17F13 TeChniCal Manual
(Rev. 1.0)

Advertisement

Table of Contents
loading

Table of Contents