ISD94100 Series Technical Reference Manual
Sep 9, 2019
Page
629
of 928
Rev1.09
IS
D
9
410
0
S
ER
IE
S
T
E
C
HN
ICA
L
RE
F
E
RE
NCE
M
AN
U
AL
I2C_DAT
(SLA+R)
ACK
NAK
I2C_DAT
(Data)
NAK
I2C_DAT
(Data)
ACK
P
S
P
Sr
I2C_DAT=SLA+R
(STA,STO,SI,AA)=(0,0,1,x)
STATUS=0x40
STATUS=0x48
STATUS=0x08
STATUS=0xF8
STATUS=0x10
STATUS=0x50
STATUS=0x58
(STA,STO,SI,AA)=(0,0,1,1)
(STA,STO,SI,AA)=(0,0,1,0)
(STA,STO,SI,AA)=(1,1,1,x)
(STA,STO,SI,AA)=(0,1,1,x)
(STA,STO,SI,AA)=(1,0,1,x)
S
STATUS=0x08
(STA,STO,SI,AA)=(1,0,1,x)
Master to Slave
Slave to Master
Arbitration Lost
I2C_DAT
(Data)
ACK
(STA,STO,SI,AA)=(0,0,1,0)
(Arbitration Lost) ACK
STATUS=0x38
I2C_DAT
(SLA+R)
ACK/
NAK
I2C_DAT=SLA+R
(STA,STO,SI,AA)=(0,0,1,X)
(Arbitration Lost)
STATUS=0x38
(STA,STO,SI,AA)=(0,0,1,X)
...
I
2
C bus will be release;
Not addressed SLV mode will be enterd
...
(STA,STO,SI,AA)=(1,0,1,X)
A START will be transmitted
when the bus becomes free
Enter not addressed SLV
mode
Send a START when bus becomes
free
MR
MT
MR
Master Receiver
MR
I2C_DAT
(SLA+R)
ACK
I2C_DAT=SLA+R
(STA,STO,SI,AA)=(0,0,1,1)
(Arbitration Lost) ACK
STATUS= 0x68, 0x78, 0xB0
To corresponding states in
slave mode
Figure 6.13-14 Master Receiver Mode Control Flow
Sample code for Figure 6.13-14, master mode receiver:
/* ------ in main routine ------ */
…
/* I2C interface initialization */
…
s_I2C0HandlerFn = (I2C_FUNC)I2C_MasterTx;
/* Setup I2C ISR callback function: master write */
I2C_SET_CONTROL_REG(I2C0, I2C_STA);
/* As an I2C master, generates START condition */
/* Wait I2C Tx Finish */
while (g_u8EndFlag == 0);
g_u8EndFlag = 0;
s_I2C0HandlerFn = (I2C_FUNC)I2C_MasterRx;
/* I2C function to read data from slave: master read */
g_u8DataLen = 0;