cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_I2C_Mem_Write with 24LC01B EEPROM

SGian.1
Senior

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

@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

 

View solution in original post

2 REPLIES 2

@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

 

My God i diden't take care of it. 

Sorry 

Thank you soo much 

Sergio