Skip to main content
jm.2
Associate III
February 8, 2023
Solved

How to implement LTC4015 with Stm32L072 MCU, I want to charge the battery through LTC4015 using I2C. Can you please suggest me how to use this in stm32 microcontroller.

  • February 8, 2023
  • 2 replies
  • 4422 views

How to implement LTC4015 with Stm32L072 MCU, I want to charge the battery through LTC4015 using I2C. Can you please suggest me how to use this in stm32 microcontroller. 

This topic has been closed for replies.
Best answer by Foued_KH

Hello @jm.2​ ,

If we look at the datasheet of the LTC4015 :

  • The address : " I2C Address :1101_000[R/W]"
  • The LTC4015 serial port is compatible with the 400kHz speed

Finally, open STM32CubeMx and start the configuration. :D

I recommend you this WIKI : Getting started with I2C - stm32mcu ,It will help you for the configuration.

Hope my answer helped you!

Foued

2 replies

Foued_KH
Foued_KHBest answer
ST Employee
February 8, 2023

Hello @jm.2​ ,

If we look at the datasheet of the LTC4015 :

  • The address : " I2C Address :1101_000[R/W]"
  • The LTC4015 serial port is compatible with the 400kHz speed

Finally, open STM32CubeMx and start the configuration. :D

I recommend you this WIKI : Getting started with I2C - stm32mcu ,It will help you for the configuration.

Hope my answer helped you!

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
jm.2
jm.2Author
Associate III
February 24, 2023

Hi sir,

Can you please tell me how to send the LTC4015 commands in stm32. If you have any sample code means send me. Please help me on this.

Thanks in advance.

Foued_KH
ST Employee
February 24, 2023

Hello ,

Battery charge voltage is pin selectable and I 2C adjustable. Input current limit and charge current can be accurately programmed with sense resistors and can be individually adjusted via the I2C serial port

So you can try to manage your application via I2C commands :

/* Write an amount of data in blocking mode to a specific memory address*/
HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
 
/*Read an amount of data in blocking mode from a specific memory address*/
HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
JM S.1
Associate
February 13, 2023

Thank you. But no useful =)​