2021-07-27 05:24 AM
Hello folks,
Since my last post, I still couldn't solve my I2C communication problem. I thought maybe return is not HAL_OK for my function so that I couldn't find any I2C addresses. And my guess was correct. I'm getting HAL_ERROR but it doesn't mean anything to me. What could be the reason I am getting this error.
Last time I couldn't upload my file, so here it is.
RCC -> HSE -> Ceramic
My clock setting is -> 8Mhz for input freq
HCLK = 84MHz
For pins,
PG13 & PG14 for LEDs
PG13 used for every scan is over,
PG14 used for interrupt (Just check if somethings is wrong but seems not!)
PA0 user button for external interrupt
I2C3 is used since others are not available for external usage. from the datasheet.
I connect PCF8574T directly.
I can found the address via Arduino but with STM, I can't
my SPI settings is Standard mode (100MHz) set by CubeMX
most of the things set up by CubeMX.
I am waiting for your kind support,
Kind Regards.
2021-07-27 07:05 AM
Then, is it possible to STM doesn't recognize any device? I increase the trial from 1 to 3. I can also increase the time out from 10 to 100.
2021-07-27 07:10 AM
OKAY NOW,
I got I2C addresses of
0-1-78-79-130-131
Tomorrow, I'll connect Arduino with known addresses.
So that I could say something, for now, THANKS TO ALL OF YOU!
2022-03-24 05:15 AM
replace your line with this one and give it a try.
HAL_I2C_IsDeviceReady(&hi2c3, (uint16_t)(counter<<1), 3, 10);