Texas Instruments MSP430x1xx User Manual page 319

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

2
15.2.1 I
C Module Initialization
The I
using USART0 in I
default value for the U0CTL register is the UART mode. To select I
the SYNC and I2C bits must be set. After module initialization, the I
is ready for transmit or receive operation. Setting I2CEN releases the I
module for operation.
Configuring and re-configuring the I
0 to avoid unpredictable behavior. Setting I2CEN = 0 has the following effects:
-
-
-
-
-
-
-
When re-configuring the USART from I
SYNC, and I2CEN bits must first be cleared, then the SWRST must be set and
the UART or SPI initialization procedure must be followed. Failure to follow this
procedure could result in unpredictable operation.
Note: Configuring the USART Module for I
The required I
1) Select I
2) Disable the I
3) Configure the I
4) Set I2CEN via software (BIS.B
Failure to follow this process may result in unpredictable USART behavior.
Note: Re-Configuring the USART Module for UART or SPI Operation
When re-configuring the USART module for UART or SPI operation from I
operation, the required process is:
1) Clear I2C, SYNC, and I2CEN (CLR.B
2) Set SWRST (MOV.B
3) Continue with UART or SPI initialization procedure.
Failure to follow this process may result in unpredictable USART behavior.
2
C module is part of the USART peripheral. Individual bit definitions when
2
C mode are different from that in SPI or UART mode. The
2
I
C communication stops
SDA and SCL are high impedance
I2CTCTL, bits 3-0 are cleared and bits 7-4 are unchanged
I2CDCTL and I2CDR register is cleared
Transmit and receive shift registers are cleared
U0CTL, I2CNDAT, I2CPSC, I2CSCLL, I2CSCLH registers are unchanged
I2COA, I2CSA, I2CIE, I2CIFG, and I2CIV registers are unchanged
2
C configuration process is:
2
C mode with SWRST = 1 (BIS.B
2
C module (BIC.B
2
C module with I2CEN = 0
#SWRST,&U0CTL)
USART Peripheral Interface, I
2
I
C Module Operation
2
C module must be done when I2CEN =
2
C mode to UART or SPI mode the I2C,
2
C Operation After Reset
#I2C + SYNC,&U0CTL)
#I2CEN,&U0CTL)
#I2CEN,&U0CTL)
&U0CTL)
2
C Mode
2
C operation
2
C module
2
C
2
C
15-5

Advertisement

Table of Contents
loading

Table of Contents