USCI Operation: I2C Mode
21-10
Universal Serial Communication Interface, I2C Mode
Slave Mode
The USCI module is configured as an I
2
C slave by selecting the I
2
C mode with
UCMODEx = 11 and UCSYNC = 1 and clearing the UCMST bit.
Initially the USCI module must be configured in receiver mode by clearing the
UCTR bit to receive the I
2
C address. Afterwards, transmit and receive
operations are controlled automatically depending on the R/W bit received
together with the slave address.
The USCI slave address is programmed with the UCBxI2COA register. When
UCA10 = 0, 7-bit addressing is selected. When UCA10 = 1, 10-bit addressing
is selected. The UCGCEN bit selects if the slave responds to a general call.
When a START condition is detected on the bus, the USCI module will receive
the transmitted address and compare it against its own address stored in
UCBxI2COA. The UCSTTIFG flag is set when address received matches the
USCI slave address.
I
2
C Slave Transmitter Mode
Slave transmitter mode is entered when the slave address transmitted by the
master is identical to its own address with a set R/W bit. The slave transmitter
shifts the serial data out on SDA with the clock pulses that are generated by
the master device. The slave device does not generate the clock, but it will hold
SCL low while intervention of the CPU is required after a byte has been
transmitted.
If the master requests data from the slave the USCI module is automatically
configured as a transmitter and UCTR and UCBxTXIFG become set. The SCL
line is held low until the first data to be sent is written into the transmit buffer
UCBxTXBUF. Then the address is acknowledged, the UCSTTIFG flag is
cleared, and the data is transmitted. As soon as the data is transferred into the
shift register the UCBxTXIFG is set again. After the data is acknowledged by
the master the next data byte written into UCBxTXBUF is transmitted or if the
buffer is empty the bus is stalled during the acknowledge cycle by holding SCL
low until new data is written into UCBxTXBUF. If the master sends a NACK
succeeded by a STOP condition the UCSTPIFG flag is set. If the NACK is
succeeded by a repeated START condition the USCI I
2
C state machine
returns to its address-reception state.
Summary of Contents for MSP430x4xx Family
Page 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Page 2: ......
Page 6: ...vi ...
Page 114: ...3 76 RISC 16 Bit CPU ...
Page 304: ...5 20 FLL Clock Module ...
Page 340: ...7 8 Supply Voltage Supervisor ...
Page 348: ...8 8 16 Bit Hardware Multiplier ...
Page 372: ...9 24 32 Bit Hardware Multiplier ...
Page 400: ...10 28 DMA Controller ...
Page 428: ...13 10 Basic Timer1 ...
Page 466: ...15 24 Timer_A ...
Page 522: ...17 30 USART Peripheral Interface UART Mode ...
Page 544: ...18 22 USART Peripheral Interface SPI Mode ...
Page 672: ...23 12 Comparator_A ...
Page 692: ...24 20 LCD Controller ...
Page 746: ...26 28 ADC12 ...