I
2
C Time-out Control
In order to reduce the problem of I
2
C lockup due to reception of erroneous clock sources, clock, a
time-out function is provided. If the clock source to the I
2
C is not received then after a fixed time
period, the I
2
C circuitry and registers will be reset.
The time-out counter starts counting on an I
2
C bus
²
START
²
&
²
address match
²
condition, and is
cleared by an SCL falling edge. Before the next SCL falling edge arrives, if the time elapsed is greater
than the time-out setup by the I2CTOC register, then a time-out condition will occur. The time-out
function will stop when an I
2
C
²
STOP
²
condition occurs.
When an I
2
C time-out counter overflow occurs, the counter will stop and the I2CTOEN bit will be
cleared to zero and the I2CTF bit will be set high to indicate that a time-out condition as occurred. The
time-out condition will also generate an interrupt which uses the I
2
C interrrupt vector. When an I
2
C
time-out occurs the I
2
C internal circuitry will be reset and the registers will be reset into the following
condition:
Register
After I
2
C Time-out
SIMDR, SIMAR, SIMC0
No change
SIMC1
Reset to POR condition
I
2
C Registers After Time-out
The I2CTOF flag can be cleared by the application program. There are 64 time-out periods which can
be selected using bits in the I2CTOC register. The time-out time is given by the formula:
((1~64)
´
32) / f
LIRC
. This gives a range of about 1ms to 64ms. Note also that the LIRC oscillator is
continuously enabled.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3
8-Bit Touch Key Flash MCU
Rev. 1.50
95
April 28, 2020
I C t i m e - o u t
c o u n t e r s t a r t
I C t i m e - o u t c o u n t e r r e s e t
o n S C L n e g a t i v e t r a n s i t i o n
1
0
1
0
0
1
0
0
1
0
0
1
0
1
0
1
1
S C L
S t a r t
S D A
S R W
A C K
S t o p
S C L
S D A
S l a v e A d d r e s s
2
2
I
2
C Time-out