2023-09-14 12:17 AM
Hi currently I am implementing a smart battery charger using stm32 & ltc4015.
But i could not understand how to perfectly configure ltc4015 through i2c protocol.
So could you please inform me how to write the i2c sequences to safely charge the battery.
Thanks & Regards
Satyabrata Senapati
Solved! Go to Solution.
2023-10-06 03:35 AM
sorry
After reading datasheet I got the solution as follows:-
//Enable limit alerts
//first send lower byte then send higher byte
uint8_t dataBuffer0[2] = {0xF0,0xBF};
ret = HAL_I2C_Mem_Write(&hi2c1, LTC4015_DEVICE_ADDRESS_WRITE, 0x0D, I2C_MEMADD_SIZE_8BIT, dataBuffer0, 2, HAL_MAX_DELAY);
if (ret != HAL_OK)
{
Error_Handler();
}
ret = HAL_I2C_Mem_Read(&hi2c1,LTC4015_DEVICE_ADDRESS_READ,0x0D,I2C_MEMADD_SIZE_8BIT,(uint16_t*)(®ister_value2), 2, HAL_MAX_DELAY);
if (ret != HAL_OK)
{
Error_Handler();
}
Best Regards
Satyabrata Senapati
Vasmed Health Sciences Pvt Ltd.
2023-09-14 12:59 AM
Your question is essentially identical to this one and should therefore be answered.
Hope that helps?
Regards
/Peter
2023-09-14 01:52 AM
Hello sir I have already followed the answer to the question.
But I am not getting clear configuration results. Kindly give me clear tips how to perfectly configure the ltc4015.
so that it will charge the battery(RRC3570) in safe mode.
I mean the command sequence.
Thanks & Regards
Satyabrata Senapati
2023-09-14 02:38 AM
Well, the LTC4015 is from a different manufacturer, I can only speak for the STM32. The user in the other thread had the same problem. So you would have to talk to Analog Devices or ask in their forum.
Good luck!
/Peter
2023-09-14 02:49 AM
ok sir thanks for the information.
2023-10-06 03:35 AM
sorry
After reading datasheet I got the solution as follows:-
//Enable limit alerts
//first send lower byte then send higher byte
uint8_t dataBuffer0[2] = {0xF0,0xBF};
ret = HAL_I2C_Mem_Write(&hi2c1, LTC4015_DEVICE_ADDRESS_WRITE, 0x0D, I2C_MEMADD_SIZE_8BIT, dataBuffer0, 2, HAL_MAX_DELAY);
if (ret != HAL_OK)
{
Error_Handler();
}
ret = HAL_I2C_Mem_Read(&hi2c1,LTC4015_DEVICE_ADDRESS_READ,0x0D,I2C_MEMADD_SIZE_8BIT,(uint16_t*)(®ister_value2), 2, HAL_MAX_DELAY);
if (ret != HAL_OK)
{
Error_Handler();
}
Best Regards
Satyabrata Senapati
Vasmed Health Sciences Pvt Ltd.