bq7693003DBT +PIC18F单片机 读取SYS_STAT状态位出错问题请教,ALERT引脚一直为高电平?

大家好,第一次使用BQ76930芯片有些问题请教下,我是参照官方提供的工程实例移植到PIC单片机上,可以正常读取I2C数据。

1、不能读取相应的电池电压、总压、温度数据问题为状态寄存器(DEVICE_XREADY)为高,读取SYS_STAT 值为0X20。

2、ALERT引脚如何使用,我现在单片机配置为输入模式是否正确?

下面是原理图

在线期待大家回复!

8 个回复

  • You mention VC1 to VC10 voltages present, be sure the power filters components are present and power pins connected (VSS, VC5X, BAT).
    Be sure TS2 has a pull down resistance to VC5X. Normally these are the thermistors, but a resistor can be substituted. If the pull downs are to VSS the part will do exactly as you describe.
    Also be sure there is a nominal 3.3V voltage across the CAP2 and across CAP3. If the TSn pull downs are incorrect one or both will be 0. Since all ADC readings are 0 probably CAP2 voltage is missing. Also check for assembly issues such as a solder short across the capacitor or incorrect component (resistor instead of capacitor).
    Also check for solder bridges at the IC pinsfrom CAP2 to VC10X or CAP3 to BAT which would leave the part hot and likely damaged.
    If all is connected and voltage are present but the part does not reply it may have been damaged in assembly or test.
  • DEVICE_XREADY在芯片唤醒时有可能是为1,可以往该bit写入1来把它清掉
  • 回复 Hugo Zhang:

    上次的问题,是电池欠压保护导致的。

    系统状态配置250MS读取一次库仑计数据 ,

    现在问题

    1、芯片本身的库仑计部分不能正常运行,一直进不了

    2、电池采集位置不对,是不是需要重新配置相应的地址位?

    屏蔽判断库仑计标志函数段后,能读取电池总压,电池单体4不正常?现在配置的是7串电池系统

    BQ76930寄存器映射地址:

    查看电池4读取数据就是47MV

    我是按照手册提供方法配置的端口配置

    请各位老师指点下!

  • 回复 user3674019:

    问题2,采集单体电压值不对现象找到原因了

    是单体电压计算时读取寄存器位置问题,利用查表方法对应单体电池寄存器位置,

     int16_t BqGetCellVoltage(uint8_t cell)          //BQ读取单体电压值
    {
        uint16_t vCell;
        if((cell == 0)||(cell > NUMBER_OF_CELLS))
        {
            return 0;
        }
        else
        {
            switch(cell)                         // 
            {  
                case 1:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC1_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                case 2:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC2_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                case 3:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC3_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                case 4:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC5_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                case 5:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC6_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                
                case 6:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC7_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                case 7:     
                if(I2CReadRegisterWordWithCRC(BQMAXIMO, (VC10_HI_BYTE), &vCell) < 0)
                {
                    //i2c error
                    bqI2CError = TRUE;
                    return 0;
                }
                else
                {
                    bqI2CError = FALSE;
                    return(BqCellVoltageConversion((vCell&0x3FFF),bqAdcGain,bqAdcOffset));   //return value in mV
                } break;
                default:    break;
            }
    读取7串电压,能正常读取了,
    但是方法有些笨,如何优化这部分代码
  • 回复 user3674019:

    为什么库仑计一直不能正常运行!一直没有数据,在线期待老师指导
  • 回复 user3674019:

    你有没有使能CC_EN bit?库伦计默认是不打开的,需要MCU去配置打开。
  • 回复 Hugo Zhang:

    库仑计默认情况下是没有打开,之前库仑计不能运行的问题是DSG_ON ,GHG_ON 两个标志位没有置1 导致的问题

    现在库仑计可以工作了,为什么 芯片ALERT 引脚始终不能触发置1 ?

    一直困惑中,期待回复!