2022-07-26 11:06 PM
Hi there,
I have made the touch project by touchgfx and initiated the I2C3 by cubemx.
I am interfacing the SHT25 with STM32F4239I-DISC1 board BY I2C3. PA8 AND PC9.
I am using the command HAL_I2C_Master_Transmit and HAL_I2C_Master_Receive. but I cannot get the values from the protocol. Any help is required.
2022-07-26 11:29 PM
Use a sw bitbang first to get the fundation working. Check if the sensirion device has i2c protocol limitation in the past, they even provide drivers as workaround. Use low bitrate if there is a builtin mcu to convert analog sensor into a digital one. That is the case for sht30 for example.
2022-07-27 12:32 AM
do you have any example for i2c3? because when i generate the code the i2c is configuring for memory interface only.
2022-07-27 12:33 AM
or can i go for baremetal programming?
2022-07-27 01:31 AM
@Madhusudan "I cannot get the values from the protocol. "
Give more details:
2022-07-27 03:42 AM
there is no frequency on SDA and SCL
2022-07-27 03:43 AM
Yes address is correct, both pins are pullups and there si no conflict in Disco board they are free pins
2022-07-27 04:02 AM
So that obviously explains why you can't get anything from the sensor!
Now you need to find out why there's no activity - most likely your STM32 configuration, or your external hardware - or both.
Are the lines stuck high or low?
Where, exactly, did you check?
Try checking directly at the processor pins with the sensor disconnected: if there's activity without the sensor connected, but that stops when it is connected - think what that tells you ...
These questions remain:
Plus:
2022-07-27 04:03 AM
@Madhusudan "both pins are pullups"
What pullups are you using, exactly?
2022-07-27 04:17 AM
@Madhusudan "address is correct"
How have you verified that?
Remember that it's not just a matter of knowing what the address is - you have to make sure that you present it to the libraries in the correct form: