24C16RP EEPROM INTERFACING WITH STM32G070CBT6
Hello all,
I am trying to interface 24C16RP EEPROM with my MCU soldered on breakout board and it seems like the EEPROM is behaving very weird when i am trying to write and read. first of all it starts to write from position 1 not from zero of an array that i have created to store the data and i tried a lot to figure out the cause but i couldn't and the weird part is that after writing to a specific page if am trying to read any other page of the entire page address it returns the same date i have written to it. As i know this EEPROM has 16 byte of page size and 128 pages correct me if i am wrong. With that said i am attaching the cube mx code and the ioc file and some screen short for your better understanding. Please help me if you find something error in my code.
Thanks
uint8_t data_Read[16];
uint8_t data_Write[16]="1234567898765432";
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_I2C1_Init();
MX_USART1_UART_Init();
HAL_I2C_Mem_Write(&hi2c1, 0XA0, 1, 2, data_Write, 16, 1000);
HAL_Delay(5);
HAL_I2C_Mem_Read(&hi2c1, 0XA0, 9, 2, data_Read, 16, 1000);
while (1)
{
HAL_UART_Transmit(&huart1, data_Read, 16, 1000);
HAL_Delay(1000);
}
}
