9-18 Intel® PXA26x Processor Family Developer’s Manual
Inter-Integrated Circuit Bus Interface Unit
9.5 Slave Mode Programming Examples
The following sub-sections describe slave mode program ming.

9.5.1 Initialize Unit

To initialize the unit:
1. Set the slave address in the ISAR.
2. Enable desired interrupts in the ICR.
3. Set the ICR[IUE] bit to enable the I2C unit.

9.5.2 Write n Bytes as a Slave

To wri te n bytes as a slave:
1. When a Slave Address Detected interrupt occurs.
Read ISR: slave address detected (1), unit busy (1), R/nW bit (1), ACK/NAK (0)
2. Write a 1 to the ISR[SAD] bit to clear the interrupt.
3. Return from interrupt.
4. Load data byte to transfer in the IDBR.
5. Set ICR[TB] bit.
6. When a IDBR transmit empty interrupt occurs.
Read ISR: IDBR transmit empty (1), ACK/NAK (0), R/nW bit (0)
7. Load data byte to transfer in the IDBR.
8. Set the ICR[TB] bit.
9. Write a 1 to the ISR[ITE] bit to clear interrupt.
10. Return from interrupt.
11.Repeat steps 6 to 10 for n-1 times. If, at any time, the slave does not have data, the I2C unit
keeps SCL low until data is available.
12. When a IDBR transmit empty interrupt occurs.
Read ISR: IDBR transmit empty (1), ACK/NAK (1), R/nW bit (0)
13. Write a 1 to the ISR[ITE] bi t to clear interrupt.
14. Return from interrupt
15. W hen slave stop detected interrupt occurs.
Read ISR: unit busy (0), slave STOP detected (1)
16. Write a 1 to the IS R[SSD] bit to clear i nterrupt.