‎2022-07-21 01:44 PM
Hello,
if I call the read function it sends a write on the I2C. What am I doing wrong?
Thanks a lot, Best Regards, Seppel
uint8_t i2cData[8U];
uint8_t i2cDevAdr = (0x53 << 1U);
HAL_I2C_Mem_Read (&hi2c2, i2cDevAdr , 0x00, 1U, i2cData, 1U, HAL_MAX_DELAY);
Solved! Go to Solution.
‎2022-07-21 02:03 PM
Of course it does, it's a memory/register access command.
It does a I2C W of 8 to 16-bit to the device, and then reverses, and reads the data from the device at that address
The 0x53 is the SLAVE Address of the I2C
The 0x00 is the ADDRESS within the devices address space, ie an EEPROM, FLASH, RTC, etc
‎2022-07-21 02:03 PM
Of course it does, it's a memory/register access command.
It does a I2C W of 8 to 16-bit to the device, and then reverses, and reads the data from the device at that address
The 0x53 is the SLAVE Address of the I2C
The 0x00 is the ADDRESS within the devices address space, ie an EEPROM, FLASH, RTC, etc
‎2022-07-21 02:10 PM
Thanks, very true, I was confused,... nearly midnight and I can't get the device to respond,... just gives me a NACK, Signals are good, debugging since hours :\ ,... can I delete that useless Post somehow?
‎2022-07-22 08:00 AM
Let's not delete things.. damages the forum.
The mechanics of I2C can be confusing at the best of times, and so many devices have odd quirks and behaviours.