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.

interfacing BQ2060 to MSP430F23x via I2C (USCI B0) module

Other Parts Discussed in Thread: BQ2060

I am trying to interface a BQ2060 battery pack to MSP 430 via I2C .

Can someone give me some code examples for the same.

 

I am new to this.

 

 

We are trying to migrate from PIC to MSP.

As of now we are sing this code.The current problem is we are unable to get fsclk.SMCLK of 1MHz is coming properly.

 

Thank you.

 

 

  • Here is some sample MSP430 code which shows using HDQ and I2C communications (both bit-banging and using the built-in hardware):

    http://focus.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slva413a&docCategoryId=1&familyId=342

     

  • Dear DMax

     

    We are trying to eshtablish Master - Slave I2C communication using USCI module from MSP430F2xx to BQ2060.

    Below is the code that we are trying to program the MSP with. We havent started I2C communication . We are stuck up with clock generation of 12KHz derived from SMCLK .

    Please review and suggest what is wrong in below code.

    #include "msp430x23x.h"

    void main(void)
    {
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
      //BCSCTL1 = CALBC1_1MHZ;                    
      //DCOCTL = CALDCO_1MHZ;  
      P1DIR |= 0x10;                            // P1.4 as SMCLK
      P1SEL |= 0X10;
      P5DIR |= 0x20;       // P5.5 as SMCLK
      P5SEL |= 0X20;
     
      P3SEL |= 0x06;                            // Assign I2C pins to USCI_B0
      UCB0CTL1 |= UCSWRST;                      // Enable SW reset
      UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC;     // I2C, Master, synchronous mode
      UCB0CTL1 = UCSSEL_2 + UCSWRST;            // Use SMCLK, keep SW reset
      UCB0BR0 = 83;                             // fSCL = SMCLK/83 = ~12kHz
      UCB0BR1 = 0;
      UCB0I2CSA = 0x16;                        // Slave Address is 16h
      UCB0CTL1 &= ~UCSWRST;                     // Clear SW reset, resume operation
      UCB0I2CIE = UCNACKIE;         // Enable NACK interrupt
      IE2 = UCB0TXIE;                            // Enable
      UCB0CTL1 |= UCTR + UCTXSTT;               // I2C TX, start condition  
    }

     

    Thank you.

     

    Regards

    Tony