NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 518 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
To enable I
2
C
’s clock, please refer to register CLK_PCLKEN1. Set I2C0 (CLK_PCLKEN1[0]) high
to enable I
2
C 0 clock while set I2C1 (CLK_PCLKEN1[1]) high to enable I
2
C 1 clock.
5.18.5 Functional Description
On I
2
C bus, data is transferred between a Master and a Slave. Data bits transfer on the SCL and
SDA lines are synchronously on a byte-by-byte basis. Each data byte is 8-bit long. There is one
SCL clock pulse for each data bit with the MSB being transmitted first, and an acknowledge bit
follows each transferred byte. Each bit is sampled during the high period of SCL; therefore, the
SDA line may be changed only during the low period of SCL and must be held stable during the
high period of SCL. A transition on the SDA line while SCL is high is interpreted as a command
(START or STOP). Please refer to the following figure for more detailed I
2
C BUS Timing.
t
BUF
STOP
SDA
SCL
START
t
HD;STA
t
LOW
t
HD;DAT
t
HIGH
t
f
t
SU;DAT
Repeated
START
t
SU;STA
t
SU;STO
STOP
t
r
Figure 5.18-2 I
2
C Bus Timing
The device’s on-chip I
2
C provides the serial interface that meets the I
2
C bus standard mode
specification. The I
2
C port handles byte transfers autonomously. To enable this port, the bit ENS1
in I2CON should be set to '1'. The I
2
C hardware interfaces to the I
2
C bus via two pins: SDA and
SCL. When I/O pins are used as I
2
C ports, user must set the pins function to I
2
C in advance.
Note:
Pull-up resistor is needed for I
2
C operation as the SDA and SCL are open-drain pins
I
2
C Protocol
5.18.5.1
The following figure shows the typical I
2
C protocol. Normally, a standard communication consists
of four parts:
1). START or Repeated START signal generation
2). Slave address transfer
3). Data transfer
4). STOP signal generation
SCL
SDA
S
or
Sr
MSB
ACK
P
or
Sr
P
Sr
LSB
MSB
LSB
1
2
7
8
9
1
2
3 - 7
8
9
A6
A5
A4 - A1
A0
R/W
D7
D6
D5 - D1
D0
NACK
ACK
Figure 5.18-3 Data transfer on the I
2
C-bus