HAL_I2C_Mem_Read() put's out a write on the STM32G4?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-21 1: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.
- Labels:
-
I2C
-
STM32Cube MCU Packages
-
STM32G4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-21 2: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
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-21 2: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
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-21 2: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-22 8: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.
Up vote any posts that you find helpful, it shows what's working..
