This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5419 USCI_I2C_module problem

Hi All!

I have a problem with USCI_B0 init control.

NOTE: Initializing or re-configuring the USCI module

The recommended USCI initialization/reconfiguration process is:

 

 

1. Set UCSWRST ( BIS.B #UCSWRST,&UCxCTL1).

2. Initialize all USCI registers with UCSWRST = 1 (including UCxCTL1).

3. Configure ports.

 

 

4. Clear UCSWRST via software (BIC.B #UCSWRST,&UCxCTL1).

quotation: slau208e_MSP430x5xx Family User's Guide (Rev. E); page 523 <http://focus.ti.com/lit/ug/slau208e/slau208e.pdf>

 

 

MY CODE ( compiler  GCC: Build date: 20081230 Binutils version: 2.18 (with patches) GCC version: 3.2.3 (with patches) GDB version: 6.8 (with atches) ):

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

cli();

 

 

//configure SDA and SCL pins

P3OUT &=~ ( MASK_SDA | MASK_SCL );   

//P3.1 & P3.2 set low level

P3SEL |= ( MASK_SDA | MASK_SCL );

//P3.1 & P3.2 config as SDA & SCL

                                                           // P3DIR |= ( MASK_SDA | MASK_SCL ); //P3.1 & P3.2 config as output

 

UCB0I2CIE =

0x00;

UCB0IE =

0x00;

 

 

// HOLD I2C MODULE IN RESET

UCB0CTL1 |= I2C_UCSWRST;             

//Hold I2C module in reset

 

 

// configure uart registers in I2C mode

UCB0CTL0 |= ( UCSYNC + UCMODE1 + UCMODE0 );    

//Synchronous mode; I2C mode; Master mode;

UCB0CTL1 |= ( UCSSEL1 + UCSSEL0 );                       

//BRCLK = SMCLK

UCB0BR0 =

80;                   //(UCB0BR0+UCB0BR1*256)

UCB0BR1 =

0;                     //I2C_clk_SCL = 8Mhz/(80+0) = 100kHz

UCB0I2CSA =

0x50;            //Load Slave address 0b1010000 (for 24C256_eeprom)

 

 

//RELEASE I2C MODULE

UCB0CTL1 &=~ I2C_UCSWRST;

//Release I2C module from reset

UCB0CTL1 =

0xC0;

__asm__ __volatile__(

"BIC.B #0x01, &0x05E1" );

UCB0CTL1 ^=

0x01;

//AFTER THIS ACTIONS I2C_UCSWRST bit ( Software reset enable ) DO NOT CLEARED!!!!!!                          WHY?!

sei();

Please help! How to clear bit UCSWRST? May be may initializing algorithm is incorrect?

**Attention** This is a public forum