
TM1100 Preliminary Data Book
Philips Semiconductors
15-6
PRELIMINARY INFORMATION
File: i2c.fm5, modified 7/25/99
Data transfer from a master transmitter to a slave
receiver, also called a WRITE operation. The rst
byte transmitted by the master is the slave address.
Then the desired number of data bytes follow. The
slave receiver returns an acknowledge bit after each
byte. The master terminates the transaction by a
STOP after the last byte.
Data transfer from slave transmitter to master
receiver, also called a READ operation.The rst byte
(the slave address), is transmitted by the master and
acknowledged by the slave. The selected slave trans-
mits successive data bytes which are each acknowl-
edged by the master, except the last byte desired by
the master, for which the master generates a ‘not-
ack’ condition. This causes the slave to terminate
byte transmission. The slave transmitter then must
release the bus so that the master may generate a
STOP condition.
The type of transaction is indicated by the LSbit of the ad-
dress byte. Data transfer from a master transmitter to a
slave receiver is called a WRITE. It is signified by a ‘0’ in
the LSbit of the address byte. Data transfer from a slave
transmitter to a master receiver is called a READ. It is
signified by a ‘1’ in the LSBit of the address byte.
Example steps for successful programming of the I2C in-
terface on TM1100 are outlined as follows for both reads
and writes. Enable the I2C interface prior to attempting
any accesses to external I2C devices.
To enable the interface:
Set bit IIC_CR.ENABLE (0x10340c) = 1
For write addressing mode:
i) On entry, clear any possible I2C interrupt sources by
writing IIC_CR bits [25:22] = ‘1111’. (Note that program-
mers must mask and enable high level interrupt sources
through the VIC facility in the DSPCPU. See the appro-
priate TM1100 databook chapter).
ii) Enable desired I2C interrupt sources by setting
IIC_CR[31:28] bits appropriately.
iii) Simultaneously load IIC_AR[31:25] with 7-bit slave
address, IIC_AR.DIRECTION = 0 and IIC_AR[15:8] with
the appropriate bytecount for the transfer.
iv) Load IIC_DR[31:0] with data for the write. Note that
writing this register triggers the transfer across the I2C
bus.Up to 4 bytes will be transferred after writing, depen-
dent on bytecount in IIC_AR[8:15}.Transfers of more
than 4 bytes have to be done by breaking them down into
a sequence of 4-byte transfers and a last transfer which
may be less than 4 bytes. This is done by repeatedly re-
loading the register until the bytecount is fulfilled. Trans-
fer is done high byte first, proceeding to low byte.
v) Detect I2C resulting condition code in IIC_SR[31:28]
and respond - OR - Detect I2C high level interrupt and re-
spond. (Note that this last step is dependent upon sys-
tem software requirements).
vi) If transfer count is not yet fulfilled, clear GDI and FI
bits and proceed with step iv) until all data is written.
For read addressing mode:
i) On entry, clear any possible I2C interrupt sources by
writing IIC_CR bits [25:22] = ‘1111’. (Note that program-
mers must mask and enable high level interrupt sources
through the VIC facility in the DSPCPU. See the appro-
priate databook chapter).
ii) Enable desired I2C interrupt sources by setting
IIC_CR[31:28] bits appropriately.
iii) Simultaneously load IIC_AR[31:25] with 7-bit slave
address, IIC_AR.DIRECTION = 1 and IIC_AR[15:8] with
the appropriate bytecount for the transfer. Note that writ-
ing this register triggers the read across the I2C bus.
iv) Detect I2C resulting condition in IIC_SR[31:28] and
respond - OR - Detect I2C interrupt and respond. (Note
that this last step is dependent upon system software re-
quirements.)
v) Clear GDI and FI bits and read the contents of IIC_DR.
Up to 4 bytes will be available in IIC_DR, fever if the re-
maining bytecount was less than 4. Bytes are stored high
byte first, proceeding to low byte.
vi) Proceed with step iv) until all data is read, i.e byte-
count is fulfilled.
15.6.1
Slave NAK
If a slave device does not generate an ACK where re-
quired, this is considered a NAK. Upon receipt of a NAK
after transmitting a device address or data byte, the mas-
ter takes the following actions:
the I2C state becomes IDLE (STATE = 000)
a STOP condition is issued on the bus
no more data is sent