Start
No
Yes
End
Clear RDR bit
(see Note 1)
Read
I2C .I2C_STAT
i
register
Is bus
free
?
Write I2C .I2C_CON with 8403h or 8401h (F/S
i
mode) or with 9403h or 9401h (HS mode)
Read I2C .I2C_STAT
i
register and save
value
I2C .I2C_STAT[1]
i
NACK bit = 0?
No
No
No
Yes
Yes
Yes
Yes
Is ACK
returned
(NACK=0)?
Is
arbitration
lost (AL=1)?
Can
update the
registers
(ARDY=1)?
I2C .I2C_STAT[0] AL
i
bit = 1?
I2C .I2C_STAT[2]
i
ARDY bit = 1?
I2C .I2C_STAT[13]
i
RDR bit = 1?
Is
last data received
at end of transfer
(RDR=1)?
Decisions
based on the
saved value of
I2C .I2C_STAT
i
register
[EXPECTED COMMAND SEQUENCE]
- Full transfer
(I2C .I2C_CON[0]STT bit; I2C I2C_CON[1] STP bit) = (1;1)
i
i.
- 2 phases transfer
(I2C .I2C_CON[0] STT bit; I2C .I2C_CON[1] STP bit) = (1;0), and then (0;1)
i
i
- Multiple phases transfer
(I2C .I2C_CON[0] STT bit; I2C .I2C_CON[1] STP bit) = (1;0), (1;0)....and then (0;1) or (1;1)
i
i
[EXPECTED I2C_IE] I2C .I2C_IE = 2007h
i
Read I2Ci.I2C_BUFSTAT[13:8]
RXSTAT to check the amount of
data left to be transmitted
Clear ARDY bit
(see Note 1)
Clear AL bit
(see Note 1)
Clear NACK bit
(see Note 1)
Transfer the amount of data left by reading
I2C .I2C_DATA register for I2C .I2C_BUFSTAT[13:8]
i
i
RXSTAT times or by activating the draining feature of
the DMA controller
I2C .I2C_CON[0] STT and
i
I2C .I2C_CON[1] STP and
i
I2C .I2C_CON[10] MST bits are
i
cleared by hardware
I2C .I2C_CON[0] STT and
i
I2C .I2C_CON[1] STP bits
i
are cleared by hardware
Reprogram the
registers
(see Note 2)
New start?
Yes
No
No
Hardware releases the serial
clock line (i2c _scl) to high
i
I C controller goes into
2
slave receiver mode.
Stop?
Yes
Is
interrupt
received?
Yes
No
Take necessary
action (DMA serves
the request
Is
DMA request
received?
Yes
No
I2C .I2C_STAT[12] BB bit = 0?
i
Set appropriate value to every bit of I2C .12C_CON register.
i
I2C .I2C_CON[15] I2C_EN bit must be set to 1 to take the I C controller
i
2
out of reset.
Setting this bit and setting other mode bits can be done simultaneously.
No
i2c-035
Public Version
www.ti.com
HS I
2
C Basic Programming Model
Figure 17-35. HS I
2
C Slave Transmitter/Receiver Mode, Polling (I
2
C Mode)
(1)
The NACK, AL, ARDY and RDR bits are cleared by writing 1 to each corresponding bit in the I2Ci.
register.
(2)
In slave transmitter mode, the amount of data requested by the external master I
2
C device is unknown; thus,
the I2Ci.
[5:0] XTRSH bit field must be configured to 0x0 (TX threshold = 1).
2809
SWPU177N – December 2009 – Revised November 2010
Multimaster High-Speed I
2
C Controller
Copyright © 2009–2010, Texas Instruments Incorporated