NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
402
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
0x98
GC mode Data NACK
0xF8
Bus Released
Note:
Status “0xF8” exists in both master/slave modes, and it won’t raise interrupt.
Table 6.14-1 I
2
C Status Code Description
6.14.5.3.6
Clock Baud Rate Bits (I2CLK)
The data baud rate of I
2
C is determines by I2CLK (I2CLK[7:0]) when I
2
C is in Master Mode, and it
is not necessary in a Slave mode. In the Slave mode, I
2
C will automatically synchronize it with any
clock frequency from master I
2
C device.
The data baud rate of I
2
C setting is Data Baud Rate of I
2
C = (system clock) / (4x (I2CLK [7:0] +1)).
If system clock = 16 MHz, the I2CLK [7:0] = 40 (0x28), the data baud rate of I
2
C = 16 MHz/ (4x
(40 +1)) = 97.5 Kbits/sec.
6.14.5.3.7
Time-out Counter Register (I2CTOC)
There is a 14-bit time-out counter which can be used to deal with the I
2
C bus hang-up. If the time-
out counter is enabled, the counter starts up counting until it overflows (TIF (I2CTOC[0]) = 1) and
generates I
2
C interrupt to CPU or stops counting by clearing ENTI(I2CTOC[2]) to 0. When time-
out counter is enabled, writing 1 to the SI (I2CON[3]) flag will reset counter and re-start up
counting after SI is cleared. If I
2
C bus hangs up, it causes the I2CSTATUS and flag SI (I2CON[3])
are not updated for a period, the 14-bit time-out counter may overflow and acknowledge CPU the
I
2
C interrupt. Refer to the following figure for the 14-bit time-out counter. User may write 1 to clear
TIF(I2C_TOC[0]) to 0.
1
0
PCLK
1/4
14-bits Counter
TIF
Clear Counter
ENTI
SI
DIV4
ENS1
To I2C Interrupt
Enable
SI
Figure 6.14-16 I
2
C Time-out Count Block Diagram
6.14.5.3.8
Wake-up Control Register (I2CWKUPCON)
When chip enters Power-down mode, 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. When the chip is
woken-up by address match with one of the four address register, the following data will be
abandoned at this time.
6.14.5.3.9
Wake-up Status Register (I2CWKUPSTS)
When system is woken up by other I
2
C master device, WKUPIF(I2CWKUPSTS[0]) is set to
indicate this event. User needs write “1” to clear this bit.