
NUC126
Aug. 08, 2018
Page
359
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
counter is enabled, the counter starts up counting until it overflows (TOIF=1) and generates I
2
C
interrupt to CPU or stops counting by clearing TOCEN to 0. When time-out counter is enabled, writing
1 to the SI flag will reset counter and re-start up counting after SI is cleared. If I
2
C bus hangs up, it
causes the I2C_STATUS and flag SI are not updated for a period, the 14-bit time-out counter may
overflow and acknowledge CPU the I
2
C interrupt. Refer to Figure 6.11-20 for the 14-bit time-out
counter. User may write 1 to clear TOIF to 0.
1
0
Pclk
1/4
14-bits Counter
TOIF
Clear Counter
TOCEN
SI
DIV4
I2CEN
To I2C Interrupt
Enable
SI
Figure 6.11-20 I
2
C Time-out Count Block Diagram
Wake-up Control Register (I2C_WKCTL)
When chip enters Power-down mode and set WKEN (WKCON [0]) to 1, other I
2
C master can wake up
our chip by addressing our I
2
C device, user must configure the related setting before entering sleep
mode. The ACK bit cycle of address match frame is done in power-down. The controller will stretch the
SCL to low when the address is matched the device’s address and the ACK cycle done, then I
2
C
controller will go ahead
. If NHDBUSEN (WKCON [7]) is set, the controller will don’t stretch the SCL to
low. Note that when
the controller don’t stretch the SCL to low, transmit or receive data will perform
immediately. If data transmitted or received when SI event is not clear, user must reset I
2
C controller
and execute the original operation again.
Wake-up Status Register (I2C_WKSTS)
When system is woken up by other I
2
C master device, WKIF (I2C_WKSTS [0]) is set to indicate this
event. User needs write “1” to clear this bit.
When the chip is woken-up by address match with one of the device address register (I2C_ADDRn),
the user shall check the WKAKDONE (I2C_WKSTS [1]) bit is set to 1 to confirm the address byte has
done. The WKAKDONE bit indicates that the ACK bit cycle of address byte is done in power-down.
The controller will stretch the SCL to low when the addres
s is matched the device’s slave address and
the ACK cycle done. The SCL is stretched until WKAKDONE is clear by user. If the frequency of SCL
is low speed and the system has wakeup from address match frame, the user shall check
WKAKDONE to confirm this frame has transaction done and then to do the wakeup procedure. Note
that user can’t release WKIF through clearing the WKAKDONE bit to 0.
The WRSTSWK (I2C_WKSTS [2]) bit records the Read/Write command before the I
2
C controller send
address. The user can read
this bit’s status to prepare the next transmitted data (WRSTSWK = 0) or to
wait the incoming data (WRSTSWK = 1) can be stored in time after the system is wake-up by the
address match frame. Note that the WRSTSWK (I2C_WKSTS [2]) bit is cleared when write one to the
WKAKDONE (I2C_WKSTS [1]) bit.
When system is woken up by other I
2
C master device, WKIF is set to indicate this event. User needs
write “1” to clear this bit.