AnsweredAssumed Answered

24C02 with STM32CubeMX

Question asked by Gustavo Adono on Aug 25, 2017
Latest reply on Sep 7, 2017 by Imen D

Hello,I'm trying to use this code to write/read a EEPROM 24C02,but it's not working,what i'm doing wrong?

Could someone post a example please?

 

 

uint8_t eedget[1],eedata[1];

 

void main()

{

eedata[0] = 0x01;

eedata[1] = 0x02;

 

while(1)

{

 

HAL_I2C_Mem_Write(&hi2c1,0x00A0,0x0000,0x0008,eedata,1,1000);
HAL_I2C_Mem_Read(&hi2c1,0x00A1,0x0000,0x0008,eedget,1,1000);

 

}

 

}

Outcomes