cancel
Showing results for 
Search instead for 
Did you mean: 

AT24C02 EEPROM Random read

KM.6
Associate

I generated the code using STM32CubeMX for STM32f423rh to communicate with AT24C02 EEPROM via i2c 1

I am can able to do page write/read by using HAL_I2C_Mem_Write_IT function. But i am not getting how to do random read.

Please provide any example code

Thank you

3 REPLIES 3

Check DataSheet

For multibyte read watch that you dont span pages, decompose into smaller reads when required.​

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

I am first time working on EEPROM and STM32

Which function i need to use from STM32 library ​to decompose into smaller read for random read

You'd have to manage the decomposition based on your understanding of the device.

ie You'd have your wrapper function to read the EEPROM, and in there you'd check the address and length request, and see how that falls on the page / page boundaries. If it involves two pages, you're going to have to split it so it reads the portion from the first page, and then the portion from the second page.

You'd use HAL_I2C_Mem_Read(_IT) twice..

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