Philips Semiconductors
I2C Interface
File: i2c.fm5, modified 7/25/99
PRELIMINARY INFORMATION
15-3
of the IIC_SR register are presented in
Table 15-3. The
IIC_SR provides four sources of interrupts. Note: the in-
terrupt should be set up as level triggered interrupt.
GDI interrupt — The GDI bit together with the FI bits
provide status about I2C transfer completion. The
interpretation of GDI/FI bit combinations are different
depending on whether the I2C interface is in master
transmit or master receive mode. Refer to
Table 15-4FI interrupt — See GDI bit denition and GDI/FI
SANACKI interrupt — This interrupt ag bit indicates
that a slave address was transmitted but no slave on
the I2C bus acknowledges the address to claim the
transaction. This is an error condition. Once the I2C
interface has set this interrupt ag, the interface is
idle. The DSPCPU should clear this interrupt ag by
writing a ‘1’ to IIC_CR.CLRSANACKI before re-
attempting this transfer or starting another I2C trans-
fer.
SDNACKI interrupt — This interrupt ag bit indicates
that an addressed slave receiver device has refused
to acknowledge the current byte of data for an ongo-
ing transfer. This is an error condition. Once the I2C
interface has set this interrupt ag, the interface is
idle. The DSPCPU should clear this interrupt ag by
writing a ‘1’ to IIC_CR.CLRSDNACKI before retrying
this transfer or starting another.
The SDA_STAT and SCL_STAT bits indicate the current
state of the SDA and SCL signals. The STATE eld indi-
cates the microactivity of the I2C interface. The eld val-
ues and their meanings are presented in
Table 15-5 The
DIRECTION status bit indicates if the I2C interface is in
transmit or receive mode.
if DIRECTION = 0 then I2C is a transmitter.
if DIRECTION = 1 then I2C is a receiver.
The RBC bitfield indicates the remaining bytecount for an
I2C
transfer in progress. The IIC_SR.RBC bitfield serves
as a read-only “shadow register” for the IIC_AR.COUNT
bitfield. During I2C transfer, the RBC bitfield will reflect
the remaining bytecount. To avoid corrupting an I2C
Table 15-3. IIC_SR Register
Bits
Field Name
Denition
31
GDI
Good Data Interrupt. This is the nor-
mal transfer complete interrupt ag.
This interrupt may be asserted without
the IIC_SR.FI interrupt bit at the end of
an I2C transfer or after master abort of
an I2C transfer.
30
FI
Full Interrupt. This interrupt indicates
the condition of the IIC_DR register
dependent upon whether the I2C inter-
face is in receive or transmit mode.
29
SANACKI
Slave Address No Acknowledge Inter-
rupt.
28
SDNACKI
Slave Data No Acknowledge Interrupt.
27
SDA_STAT
This bit is used to examine the state of
the external I2C SDA data pin. Bit
polarity is:
1 = SDA pad is low
0 = SDA pad oated high
26
SCL_STAT
This bit is used to examine the state of
the external I2C SCL clock pin. Bit
polarity is:
1 = SCL pad is low
0 = SCL pad oated high
25:23
STATE
The STATE eld indicates the microac-
tivity of the I2C bus.
22
DIRECTION Direction of current data transfer.
21
Reserved
Read as ‘0’
15:8
RBC
Remaining Byte Count.
7:0
Reserved
Read as ‘0’
Table 15-4. Master Transmit Mode GDI/FI Status
GDI
FI
Description
0
Message is not complete. The IIC_DR is not
empty. No interrupt.
0
1
Message is not complete. The IIC_DR is empty
and the requested transmit byte count is not
equal to 0. The DSPCPU must write additional
bytes of the current transfer to the IIC_DR regis-
ter.
1
X
Message transmission has completed. The
IIC_DR is empty. The byte transmit count = 0.
Table 15-5. STATE eld values
STATE
Meaning
000
I2C Interface is idle.
001
RESERVED FOR FUTURE USE
010
IDLE (MSG is done, awaiting clear GDI to go to
000 state)
011
Address phase is being processed
100
BYTE3 (rst byte) is being processed
101
BYTE2 is being processed
110
BYTE1 is being processed
111
BYTE0 (last) is being processed
Table 15-6. Master Receive GDI/FI Conditions
GDI
FI
Description
0
Message is not complete. IIC_DR is not full.
No interrupt.
0
1
IIC_DR contains received data and needs to
be read serviced. More data bytes are
expected since the receive byte count is not
equal to 0.
1
X
The transfer has been completed and the
receive byte count is equal to 0. 0 to 4 valid
bytes are in the IIC_DR register awaiting read
servicing by the DSPCPU.