Skip to main content
Visitor II
January 23, 2025
Solved

HAL_I2C_Mem_Write with 24LC01B EEPROM

  • January 23, 2025
  • 1 reply
  • 1252 views

Hi there!

here i'm for ask another help. I use STM32G031 for write and read eeprom 24LC01B , and i work with 

where Address = 0x01;

HAL_I2C_Mem_Write(hi2cDevAddress, Address , I2C_MEMADD_SIZE_8BIT, &val, 1, 100);

so if i wrote 7 byte everythingh work perfect if i wrote 8 byte ti find the last byte in the position 0x00 in my eeprom why ? 

if i change eeprom like 24lc256 and I2C_MEMADD_SIZE_16BIT

 HAL_I2C_Mem_Write(hi2cDevAddress, Address , I2C_MEMADD_SIZE_16BIT, &val, 1, 100); everythingh work perfect 

please can you help me ? 

Thanks 

Sergiio

 

    This topic has been closed for replies.
    Best answer by Andrew Neil

    @SGian.1 wrote:

    where Address = 0x01;


    Don't you need to start at Address = 0x00 ?

    If you write 8 bytes from Address 0x01, you'll go over a "page" boundary?

    https://ww1.microchip.com/downloads/aemDocuments/documents/MPD/ProductDocuments/DataSheets/24AA01-24LC01B-24FC01-1K-I2C-Serial-EEPROM-20001711N.pdf

     

    1 reply

    Super User
    January 23, 2025

    @SGian.1 wrote:

    where Address = 0x01;


    Don't you need to start at Address = 0x00 ?

    If you write 8 bytes from Address 0x01, you'll go over a "page" boundary?

    https://ww1.microchip.com/downloads/aemDocuments/documents/MPD/ProductDocuments/DataSheets/24AA01-24LC01B-24FC01-1K-I2C-Serial-EEPROM-20001711N.pdf

     

    SGian.1Author
    Visitor II
    January 23, 2025

    My God i diden't take care of it. 

    Sorry 

    Thank you soo much 

    Sergio