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.

BQ76952: OTP

Part Number: BQ76952


目的: 通过软件烧录方式 写入OTP配置;

方式:在fullAccess模式下,写入控制指令;

I2C_ReadReg(BATTERY_STATUS, (uint8_t *)&(Registers1.BatteryStatus.StatusByte), 2);// 判断Battery Status 是否是FULLACCESS;

if(1 == Registers1.BatteryStatus.StatusBit.SEC) // 判断是否在FULL_ACCESS mode;
{
I2C_ReadSubRegNoCrc(OTP_WR_CHECK, (uint8_t *)OTP_WR_CHECK_Status, 3); // 判断自检是否完成;

if((OTP_WR_CHECK_Status[0]&0x80) != 0) // Programming OK
{
I2C_WriteSubRegNoCRC(BQ_SUBCOMMAND_ADDR, OTP_WRITE, setting_data, 3); // otp write
}
if((OTP_WR_CHECK_Status[0]&0x80) != 0) // Programming OK
{
g_otp_writeToRomSuccess_flag =1;
}
else
{
g_otp_writeToRomSuccess_flag = 0;
}

}
else
{
g_otp_writeToRomSuccess_flag = 0;
}

问题点: 能够配置参数,说明已经进入FULLACCESS。但是 Registers1.BatteryStatus.StatusBit.SEC 始终为0。

               更换bq芯片,单独供电3.3V,Registers1.BatteryStatus.StatusBit.SEC 也无法置1;

非常感谢大佬的帮助。