cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Not Working

Avid
Associate II

I am unable to get the I2C line on my STM32H750VB to connect with my PCA9685 PWM driver on my custom PCB. The I2C line is constantly high, which I have seen on multiple oscilloscopes. I got the software online from a tutorial on the PWM driver and was able to run it successfully on a Nucleo-H743ZI2 board which has a STM32H743ZI MCU with a breakout of the PCA9685 so the code unrelated to board setup should work. I attached the entire code file in case though. Things I've tried: 

  • Changing the I2C pull-up resistors from 4.7k to 10k
  • Resetting the I2C bus with HAL_I2C_DeInit and HAL_I2C_Init 
  • Continuity between the MCU SCL and SDA and breakout is good 
  • Pull-up resistor values when measured between each line and 3V3 is the same 
  • Plugged in the working breakout to the custom board and took out the original PCA9685
  • Multiple system configurations with internal clocks HSI, CSI, and PLLCLK
  • Multiple I2C clock configurations with PCLK1 and HSI
  • Pulling NRST high (it is low on my board but the board has been able to run other peripherals like USB) 

Layout

Avid_1-1741218902055.png

  • Circled are the pull-up resistors and the I2C connections on the PCA9685 PWM driver, microcontroller is on the bottom left connecting to the pull-ups 

Schematic

Avid_3-1741219041931.pngAvid_4-1741219076576.png

  • I2C is connected on PB7 for SDA and PB8 for SCL

Pinout

 

Avid_6-1741219233950.png

  • SDA on PB7 SCL on PB8, and other than these the only other pin enabled is a GPIO going to an LED

Any ideas for other things to try to get the I2C bus running or what could be causing the issue? 

 

 

1 REPLY 1
TDK
Guru

> #define PCA9685_ADDRESS 0x80

The slave address is wrong. You're using 0x80 while clearly A0, A2, A4 are pulled up. Should be 0b10101010.

TDK_0-1741220403088.png

 

Ensure HAL_I2C_IsDeviceReady returns HAL_OK before using any other HAL_I2C_* function.

Look at return values from HAL function to understand why they failed.

If you feel a post has answered your question, please click "Accept as Solution".