MC97F6108A User’s manual
16. Inter Integrated Circuit (I2C)
173
16.7
Block Operation
The I2C block as peripheral design is independently operating with main CPU operation. The operation
of I2C block does a byte unit of I2C frame. After finishing a byte operation (transmit/receive data and
clock) on I2C bus system, I2C block generate I2C interrupt for next byte operation. The I2C Interrupt
service manage I2C block with the SFR registers, data load/read register (I2CDR) from/to I2C bus
system, block control register (I2CMR), the state register (I2CSR) contained operation result. An
operation unit of I2C H/W block generates/ receive 9 SCL clock that are for 8 bits data and an ACK. I2C
block send / receive ACK signal at 9
th
clock of SCL according to I2C specification.
The I2C application software initialize I2C block condition depended on clock system, I2C devices
condition after system power on.
An application S/W prepares I2C bus communication resource on RAM buffers. If it is to set the start
flag in I2CMR register. I2C block start to generate start signal and send a Slave address to slave device.
All steps of I2C communication service except start signal and slave address is done by H/W block and
I2C Interrupt service. Therefore main application software can reduce time resource while I2C Data
write/read operation.
I2C block design supports both functions of master/ Slave on the same block. In case of Masker device
it generate SCL clock to slave device and the case of slave mode receive SCL clock from master device.
I2C block decides SDA data direction with the data direction bit (R/
W̅
) of device address in both cases
of master and slave mode (TMODE bit 0-> Receive, 1-> Transmit).
NOTES:
1.
When an I2C interrupt is generated by I2C block, IIF flag in I2CMR register is set and it is cleared by
writing any value to I2CSR. When I2C interrupt occurs, the SCL line is hold LOW for reading/writing
I2CDR register and control I2CMR until writing any value to I2CSR. When the IIF flag is set, the I2CSR
contains a value for the state of the I2C bus. According to the value in I2CSR, software can decide what
to do next.
2.
I2C can operate in 4 modes by configuring master/slave, transmitter/receiver.