
MSP430
V
CC
Serial Data (SDA)
Serial Clock (SCL)
Device A
Device B
Device C
eUSCI_B Operation – I
2
C Mode
Figure 20-2. I
2
C Bus Connection Diagram
NOTE:
SDA and SCL levels
The SDA and SCL pins must not be pulled up above the device V
CC
level.
20.3.1 eUSCI_B Initialization and Reset
The eUSCI_B is reset by a PUC or by setting the UCSWRST bit. After a PUC, the UCSWRST bit is
automatically set, keeping the eUSCI_B in a reset condition. To select I
2
C operation, the UCMODEx bits
must be set to 11. After module initialization, it is ready for transmit or receive operation. Clearing
UCSWRST releases the eUSCI_B for operation.
Configuring and reconfiguring the eUSCI_B module should be done when UCSWRST is set to avoid
unpredictable behavior. Setting UCSWRST in I
2
C mode has the following effects:
•
I
2
C communication stops.
•
SDA and SCL are high impedance.
•
UCBxSTAT, bits 15-9 and 6-4 are cleared.
•
Registers UCBxIE and UCBxIFG are cleared.
•
All other bits and registers remain unchanged.
NOTE:
Initializing or re-configuring the eUSCI_B module
The recommended eUSCI_B initialization/reconfiguration process is:
1.
Set UCSWRST (
BIS.B
#UCSWRST,&UCxCTL1
).
2.
Initialize all eUSCI_B registers with UCSWRST = 1 (including UCxCTL1).
3.
Configure ports.
4.
Clear UCSWRST via software (
BIC.B
#UCSWRST,&UCxCTL1
).
5.
Enable interrupts (optional).
20.3.2 I
2
C Serial Data
One clock pulse is generated by the master device for each data bit transferred. The I
2
C mode operates
with byte data. Data is transferred MSB first as shown in
.
The first byte after a START condition consists of a 7-bit slave address and the R/W bit. When R/W = 0,
the master transmits data to a slave. When R/W = 1, the master receives data from a slave. The ACK bit
is sent from the receiver after each byte on the ninth SCL clock.
534
SLAU272C – May 2011 – Revised November 2013
Enhanced Universal Serial Communication Interface (eUSCI) – I
2
C Mode
Copyright © 2011–2013, Texas Instruments Incorporated