cancel
Showing results for 
Search instead for 
Did you mean: 

I2c Data in Stm32f072 Gets drifted by 30mv after 24 hours of RUN. I have selected clock as HSI

RKade.1
Associate III

Hi all ,

Am facing issue after 24 Hours of continious Run of Stm32f072RBT6 Controller for Change in reading of I2c BUS.

Actually i have connected one Chip to Microcoontroller over I2C Bus . That Chip is Bq76930 (AFE).

After24 Hours of Run, Controller shows drift in Values measured over I2C Bus.. Actually it should not happen so, else incorrect values will be read.

So some one Please share if any solution for avoiding Drift in values.

Or some one please share what could be the possible errors?

Forreference am adding my code driver part:-

**

 * @brief Initializes peripherals used by the I2C EEPROM driver.

 * @param None

 * @retval None

 */

void sEE_Init(void)

 I2C_InitTypeDef I2C_InitStructure;

  

 sEE_LowLevel_Init();

  

 /* I2C configuration */

 /* sEE_I2C configuration */

 I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;

 I2C_InitStructure.I2C_AnalogFilter = I2C_AnalogFilter_Disable;

 I2C_InitStructure.I2C_DigitalFilter = 0x00;

 I2C_InitStructure.I2C_OwnAddress1 = 0x00;

 I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;

 I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;

 I2C_InitStructure.I2C_Timing = sEE_I2C_TIMING;

  

 /* Apply sEE_I2C configuration after enabling it */

 I2C_Init(sEE_I2C, &I2C_InitStructure);

  

 /* sEE_I2C Peripheral Enable */

 I2C_Cmd(sEE_I2C, ENABLE);

  

 /* Select the EEPROM address */

 // sEEAddress = sEE_HW_ADDRESS;    

}

Rohit

5 REPLIES 5
TDK
Guru

Drift in what value and in what way?

BQ76930 is a battery charge/monitor chip. Seems reasonable the level of a battery could change by 30mV in 24 hours. And since readings from it are digital, seems way more likely the BQ76930 is the problem and not the STM32 chip.

If you feel a post has answered your question, please click "Accept as Solution".
RKade.1
Associate III

Bq76930 is a Protector Chip with Balance function along with I2C Interfacing.

There are 2 chips used to read 20 Cells.

Each Chip uses 10 cells , so 10+10 makes 20 cells.

Bq7693006 for Cell - 1 to Cell - 10

Bq7693002 for Cell - 11 to Cell - 20

Between Bq7693006 & bq7693002 Level shifter Isolator is used.

Now after few hours following reading is read from Bq76930 AFE:-

See attachment for quick review of readings.

Such behaviour is observed only after few hours of Running code in controller , initially all are ok.

Thanks

Rohit

TDK
Guru

This doesn't seem like an STM32 problem. If anything, it's a Bq7693002 problem, but it's not clear what sort of accuracy they guarantee, or if the reading is even wrong.

If you feel a post has answered your question, please click "Accept as Solution".

So check the values on the bus, vs those reported by the STM32

If the STM32 is accurately reporting what it is being sent I don't see how it is a problem with the STM32 or the code running on it. Focus on where the problem is.

Perhaps review how well bonded your grounds are, and look at which chips are powered in each domain, and where the pull-up resistors are drawing power from.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
RKade.1
Associate III

ok