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.

MSP430G2553 与BQ76940DEMO板IIC无法通信

Other Parts Discussed in Thread: BQ76940, MSP430G2553

MSP430G2553 与BQ76940  DEMO板IIC无法通信

1、硬件采用MSP430G2553 demo板和BQ76940  DEMO板

2、编译环境采用IAR5.3 FORMSP430 ,程序下载的TI官网上BQ76940目录下的例程

3、开发设计处于方案样机阶段

4、调试过程中单步运行程序停在下面函数

int I2CSendBytes(unsigned char I2CSlaveAddress, unsigned char *DataBuffer, unsigned int ByteCount, unsigned int *SentByte)

中的下面的位置

 while(DelayCounter < DELAY_LIMIT && (!(IFG2 & UCB0TXIFG) || (UCB0CTL1 & UCTXSTT))) //check if the byte has been sent   

{     DelayCounter++;    }

5、TI官网的程序可以拿来直接用吗?还是需要修改某些参数

  • 请先确认一下BQ76940的后缀是什么。不同的后缀代表不同的I2C地址(0x08或0x18),和I2C通讯带不带CRC校验。

  • 非常感谢你的提醒,demo 板上的是bq7694000是不带CRC,地址是0X08,

    但是我在官网下载的程序是带CRC的程序,你那有不带CRC的程序吗?

  • 还是初始化操作,我把//后的代码修改了为上面的直接调用例程里的函数,单步运行时还是一样的效果,运行到那个位置就不走了

    int GetADCGainOffset() {  int result;

     result = I2CReadRegisterByte(BQMAXIMO, ADCGAIN1, &(Registers.ADCGain1.ADCGain1Byte));  

    result = I2CReadRegisterByte(BQMAXIMO, ADCGAIN2, &(Registers.ADCGain2.ADCGain2Byte));

     result = I2CReadRegisterByte(BQMAXIMO, ADCOFFSET, &(Registers.ADCOffset));        

    //result = I2CReadRegisterByteWithCRC  (BQMAXIMO, ADCGAIN1, &(Registers.ADCGain1.ADCGain1Byte));

     //result = I2CReadRegisterByteWithCRC(BQMAXIMO, ADCGAIN2, &(Registers.ADCGain2.ADCGain2Byte));

     //result = I2CReadRegisterByteWithCRC(BQMAXIMO, ADCOFFSET, &(Registers.ADCOffset));

     return result; }