Datasheet

FS98O22
Rev. 1.6 99/146
I2C data transmit operation:
1. Configure SCL and SDA pins as open-drain through the PTOCB[4:3].
2. Set I2CEN register flag to enable the I2C module.
3. Clear I2CIF to reset the I2C interrupt.
4. Set I2CIE and GIE to enable the I2C interrupt.
5. Wait for the interrupt.
6. When the I2C master device sends data to slave side, the data (ID) transmitted from the master device
will be sent to I2CBUF, and the BF register flag will be set.
7. If the RW register flag is clear, the I2C module will enter the transmit mode.
8. The acknowledgement signal will be sent automatically and the interrupt will happen.
9. Set the CKP register flag to hold the SCK to low, and then write the data, which is ready to send to master
side, to I2CBUF.
10. Clear the I2CIF and reset the interrupt to wait for the interrupt to happen again.
11. Clear the CKP register flag to enable the SCK pin. The master side will start to get the data.
12. When interrupt happen, the master side has already finished the transmission, the acknowledgement has
been sent back to salve side, and the BF register flag has been clear.
Figure 9-4 I2C waveforms for transmission
FORTUNE'
Properties
For Reference Only