Tool/software:
I am trying to change the i2c default address fro 0x08 to 0x11 on my custom board.
After writing to the I2CAdresse register and running OTP according to the OTP programming manual.
Reading address 0x40 after OTP_WRITE returns 0x08 as per the manual yet the old address is retained.
Please any suggestins.
part of code below. Using the sample code for STM32 provided on webpage.
some dummy varaibles added for dugging purposes
CommandSubcommands(SET_CFGUPDATE);
uint16_t readData = BQ769x2_ReadRegister(I2CAddress);
void I2C_WriteReg(uint8_t reg, uint8_t* data, uint8_t length);
BQ769x2_SetRegister(I2CAddress,0x0011,2);
CommandSubcommands(EXIT_CFGUPDATE);
readData = BQ769x2_ReadRegister(I2CAddress);
Subcommands(OTP_WR_CHECK, 0x00, R);
uint8_t optdata_0 = RX_32Byte[0];
uint8_t optdata_1 = RX_32Byte[1];
CommandSubcommands(SET_CFGUPDATE);
DirectCommands(BatteryStatus, 0x00, R);
uint8_t batteystat_0 = RX_data[0];
uint8_t batteystat_1 = RX_data[1];
if((batteystat_0 & 0x80) == 0x00){
Subcommands(OTP_WR_CHECK, 0x00, R);
if(RX_32Byte[0] == 0x80){
Subcommands(OTP_WRITE, 0x00, R);
HAL_Delay(100);
uint8_t otp = RX_32Byte[0];
if(otp == 0x80){
printf("success");
}
}
}
CommandSubcommands(EXIT_CFGUPDATE);
CommandSubcommands(BQ769x2_RESET);
