
NUC126
Aug. 08, 2018
Page
832
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
For setup time wrong adjustment example, we assume one SCL cycle contains ten PCLKs and set
STCTL [5:0] (UI2C_TMCTL[5:0]) to 3 that stretch three PCLKs for setup time setting. The setup time
setting limitation:
ST
limit
= (UI2C_BRGEN[25:16]+1) - 6. For example, if user decide PCLK = 12MHz
and baud rate =100k, the UI2C_BRGEN[25:16] must set 59, and the STCTL [5:0] maximum value is
54.
SCL_OUT
PCLK
Only two PCLKs
. . . . . .
. . . . . .
Two PCLKs can not sample for SCL
Figure 6.22-17 Setup Time Wrong Adjustment
For hold time wrong adjustment example, we use I
2
C Baud Rate = 400k and PCLK = 48MHz, the SCL
high/low duty = 60 PCLK. When we set HTCTL [5:0] (UI2C_TMCTL[11:6]) to 63 and STCTL [5:0]
(UI2C_TMCTL[5:0]) to 0, then SDA output delay will over SCL high duty and cause bus error. The hold
time setting limitation:
HT
limit
= (UI2C_BRGEN[25:16]+1) - 9. For example, if user decide PCLK =
12MHz and baud rate =100k, the UI2C_BRGEN[25:16] must set 59, and the HTCTL [5:0] maximum
value is 51.
SCL
SDA
SDA delay over SCL low duty
Bus error
Figure 6.22-18 Hold Time Wrong Adjustment
I
2
C Time-out Function
There is a time-out counter TOCNT (UI2C_PROTCTL [25:16]) 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 equals TOCNT
(UI2C_PROTCTL [25:16]) and generates I
2
C interrupt to CPU or stops counting by clearing TOIEN
(UI2C_PROTIEN [0]) to 0 or setting all I
2
C interrupt signal (ACKIF, ERRIF, ARBLOIF, NACKIF,
STORIF, STARIF). User may write 1 to clear TOIF(UI2C_PROTSTS[5]) to 0. When time-out counter is
enabled, writing 1 to the TOIF will reset counter and re-start up counting after TOIF is cleared. Refer to
Figure 6.22-19 for the time-out counter TOCNT (UI2C_PROTCTL [25:16]). T
TOCNT
= (TOCNT
(UI2C_PROTCTL [25:16]) +1) x32 (5-bit) x T
PCLK
. Note that the time counter clock source TMCNTSRC
(USCI_ BRGEN [5]) must be set zero.