Note: Slaves and masters do not have to be programmed with the same type of addressing 7- or 10-bit
address. For instance, a slave can be programmed with 7-bit addressing and a master with 10-bit
addressing, and vice versa. †
4. Enable the I
2
C controller by writing a 1 in bit 0 of the
IC_ENABLE
register. †
Slave-Transmitter Operation for a Single Byte
When another I
2
C master device on the bus addresses the I
2
C controller and requests data, the I
2
C controller
acts as a slave-transmitter and the following steps occur: †
1. The other I
2
C master device initiates an I
2
C transfer with an address that matches the slave address in
the
IC_SAR
register of the I
2
C controller †
2. The I
2
C controller acknowledges the sent address and recognizes the direction of the transfer to indicate
that it is acting as a slave-transmitter. †
3. The I
2
C controller asserts the
RD_REQ
interrupt (bit 5 of the
IC_RAW_INTR_STAT
register) and waits
for software to respond. †
If the
RD_REQ
interrupt has been masked, due to bit 5 of the
IC_INTR_MASK
register (
M_RD_REQ
bit
field) being set to 0, then it is recommended that you instruct the CPU to perform periodic reads of the
IC_RAW_INTR_STAT
register. †
• Reads that indicate bit 5 of the
IC_RAW_INTR_STAT
register (
R_RD_REQ
bit field) being set to 1
must be treated as the equivalent of the
RD_REQ
interrupt being asserted. †
• Software must then act to satisfy the I
2
C transfer. †
• The timing interval used should be in the order of 10 times the fastest SCL clock period the I
2
C
controller can handle. For example, for 400 Kbps, the timing interval is 25 us. †
The value of 10 is recommended here because this is approximately the amount of time required
for a single byte of data transferred on the I
2
C bus.†
Note:
4. If there is any data remaining in the TX FIFO before receiving the read request, the I
2
C controller asserts
a
TX_ABRT
interrupt (bit 6 of the
IC_RAW_INTR_STAT
register) to flush the old data from the TX
FIFO. †
Because the I
2
C controller's TX FIFO is forced into a flushed/reset state whenever a
TX_ABRT
event occurs, it is necessary for software to release the I
2
C controller from this state by reading
Note:
the
IC_CLR_TX_ABRT
register before attempting to write into the TX FIFO. For more
information, refer to the
C_RAW_INTR_STAT
register description in the register map.†
If the
TX_ABRT
interrupt has been masked, due to of
IC_INTR_MASK[6]
register (
M_TX_ABRT
bit
field) being set to 0, then it is recommended that the CPU performs periodic reads of the
IC_RAW_INTR_STAT
register. †
• Reads that indicate bit 6 (
R_TX_ABRT
) being set to 1 must be treated as the equivalent of the
TX_ABRT
interrupt being asserted. †
• There is no further action required from software. †
• The timing interval used should be similar to that described in the previous step for the
IC_RAW_INTR_STAT[5]
register. †
5. Software writes to the
DAT
bits of the
IC_DATA_CMD
register with the data to be written and writes a
0 in bit 8.†
6. Software must clear the
RD_REQ
and
TX_ABRT
interrupts (bits 5 and 6, respectively) of the
IC_RAW_INTR_STAT
register before proceeding. †
I2C Controller
Altera Corporation
cv_54020
Slave-Transmitter Operation for a Single Byte
20-14
2013.12.30