AnsweredAssumed Answered

I2C READ NO RESPONSE

Question asked by Rohit Rajapure on Sep 23, 2017
Latest reply on Sep 23, 2017 by Vangelis Fortounas

Dear All,

 

I am configuring I2C for reading EEPROM address.

I am using PB6_I2CSCL and PB7_I2CSDA pin and have connected EEPROM AT24C A2,A1 and A0 pin to GND. 

I have written following code to read the EEPROM but i am unable to read the data.Please suggest me if am missing something in configuration or in reading part.

 

#define EEPROM_ADDRESS 0xA0 

/* USER CODE BEGIN 3 */
ui8TxData[0]=0x00;
ui8TxData[1]=0x31;
ui8TxData[2]=0x32;
ui8TxData[3]=0x33;
ui8TxData[4]=0x34;
HAL_I2C_Master_Transmit(&hi2c1,EEPROM_ADDRESS,ui8TxData,5,50);
HAL_I2C_Master_Receive(&hi2c1,EEPROM_ADDRESS|0x01,&ui8RxData[0],1,50);
HAL_I2C_Master_Receive(&hi2c1,EEPROM_ADDRESS|0x01,&ui8RxData[1],1,50);
HAL_I2C_Master_Receive(&hi2c1,EEPROM_ADDRESS|0x01,&ui8RxData[2],1,50);
HAL_I2C_Master_Receive(&hi2c1,EEPROM_ADDRESS|0x01,&ui8RxData[3],1,50);
HAL_I2C_Master_Receive(&hi2c1,EEPROM_ADDRESS|0x01,&ui8RxData[5],1,50);

HAL_Delay(100);

 

Thanks in advance 

Rohit 

Outcomes