UG-1262
Rev. B | Page 228 of 312
Low = REQD_LOW_TIME/PCLK_PERIOD
– 1
where
REQD_LOW_TIME
is the required low time period.
For 100 kHz SCL operation with a low time of 5 μs, a high time of 5 μs, and a PCLK frequency of 26 MHz,
High
= (5 μs/(1/26,000,000)) − 2 = 128 = 0x80
(22)
Low
= (5 μs/(1/26,000,000)) − 1 = 129 = 0x81
(23)
f
SCL
= 26,000,000/(128 + 129 + 3) = 100 kHz
(24)
Resetting the I
2
C Block
Three steps are needed to reset the I
2
C block. Do not reset the I
2
C peripheral on two consecutive communication sequences.
In master mode, the steps are as follows:
1.
Clear MCTL, Bit 0 to 0 and disable the I
2
C master.
2.
Set SHCTL, Bit 0 to 1, which is a write only register. Writing to this bit resets the start and stop detection circuits of the I
2
C block
and clears MSTAT, Bit 10.
3.
Set MCTL, Bit 0 to 1 to reenable the I
2
C master.
In slave mode, the steps are as follows:
1.
Clear SCTL, Bit 0 to 0 and disable the I
2
C slave.
2.
Set SHCTL, Bit 0 to 1, which is a write only register. Writing to this bit resets the start and stop detection circuits of the I
2
C block.
3.
Set SCTL, Bit 0 to 1 to reenable the I
2
C slave.
I
2
C OPERATING MODES
Master Transfer Initiation
If the master enable bit (MCTL, Bit 0) is set, a master transfer sequence is initiated by writing a value to the ADR1 register. If there is
valid data in the MTX register, it is the first byte transferred in the sequence after the address byte during a write sequence.
Slave Transfer Initiation
If the slave enable bit (SCTL, Bit 0) is set, a slave transfer sequence is monitored for the device address in Register ID0, Register ID1,
Register ID2, or Register ID3. If the device address is recognized, the device participates in the slave transfer sequence.
Note that a slave operation always starts with the assertion of one of three interrupt sources: a read request (MRXREQ, SRXREQ), a write
request (MTXREQ, STXREQ), or a general call interrupt (GCINT). The software must always look for a stop interrupt to ensure that the
transaction has completed correctly and to deassert the stop interrupt status bit.
Receive and Transmit Data FIFOs
The transmit data path consists of a master and slave transmit FIFO (each two bytes deep), the MTX register and STX register, and a
transmit shifter. The transmit status bits, MSTAT, Bits[1:0] and SSTAT, Bit 0 denote whether there is valid data in the transmit FIFO.
Data from the transmit FIFO is loaded into the transmit shifter when a serial byte begins transmission. If the transmit FIFO is not full
during an active transfer sequence, the transmit request bit (MSTAT, Bit 2 or SSTAT, Bit 2) asserts. Figure 60 shows the effect of not
having the slave transmit FIFO full at the start of a read request from a master. An extra transmit interrupt can be generated after the
read bit. This extra transmit interrupt occurs if the transmit FIFO is not full.
RE
A
D
DEVICE
ADDRESS
I2C_SDA
LINE
ACK
NO
ACK
AC
K
AC
K
AC
K
ST
O
P
R/
W
DATA (n + 2)
DATA (n + x)
DATA (n + 1)
DATA (n)
TRANSMIT
INTERRUPT
TRANSMIT
INTERRUPT
EXTRA TRANSMIT INTERRUPT
POSSIBLE IF FIFO LOADED IN
PREVIOUS INTERRUPT
TRANSMIT
INTERRUPT
TRANSMIT
INTERRUPT
TRANSMIT
INTERRUPT
166
75-
043
Figure 60. I
2
C Slave Transmit Interrupt Details