2023-11-22 12:58 AM - last edited on 2023-11-22 05:49 AM by Mike_ST
Hello,
I am trying to write something on the I2C bus to a digital potineometer using the STM32F469I-DISCO board but I get no result, even no response from the device and its like there is no device connected on the bus.
I tried the same potineometer on another board without display, STM-Neuclo board, and everything is ok as expected.
The only I2C1 interface is on the Arduino connector of the board and I am using the HAL library with the Master_Trasmit function in blocking mode.
I also tried to block all the connections of the LCD display and the bus was no longer busy, but there was no result either (ITs write nothing)!
if (HAL_I2C_IsDeviceReady(&hi2c1, PotiAdr, 2, 100) == HAL_OK)
This function always returns HAL_Error, meaning that there is no successful connection with the bus.
I have read the reference manual of the board and there is nothing special to do.
Anyone have an idea about this problem?
Note: I am using TouchGFX and FreeROTS.
Best regards,
Mahdi
Edit: I have disabled the internal pull-up resistors of SDA/SCL and now I2C_isDeviceReady returns HAL_OK, that means there is successful connection but still no right signal on Logic Analyser. (i muss receive 29bits but only 27bits on the bus)
Solved! Go to Solution.
2023-11-22 07:05 AM
Also the HIGH edges of CLK should be 29 (0-28). Now it finally works.
What I did? disabled the internal pull-up resistors (40k) because the board had external pull-ups (1.5k). The data came in and it was displayed correctly on the logic analyser.
2023-11-22 06:58 AM
> (i muss receive 29bits but only 27bits on the bus)
I2C is a byte-based protocol. How are you receiving fractions of a byte?
If it works on one board but not another, perhaps those lines are being used by other peripherals on the board. Note that external pullups are required for I2C.
2023-11-22 07:05 AM
Also the HIGH edges of CLK should be 29 (0-28). Now it finally works.
What I did? disabled the internal pull-up resistors (40k) because the board had external pull-ups (1.5k). The data came in and it was displayed correctly on the logic analyser.
2023-11-22 07:14 AM
@TDK > If it works on one board but not another, perhaps those lines are being used by other peripherals on the board.
That is definitiv, thatswhy i have mentioned the board name because its developement board and has a touch panel LCD on the bus.
@TDK > Note that external pullups are required for I2C.
The board has already pull-ups.