Skip to main content
Visitor II
September 27, 2024
Question

Trouble initializing the I2C interface

  • September 27, 2024
  • 3 replies
  • 691 views

Hi everyone, My name is Emmanuel Katto. I am having trouble initializing the I2C interface on the STM32F4 series. Could someone provide a simple example or point me to resources that detail the setup process?

 

Looking forward to your responses.

Thanks in advance!

Best,

Emmanuel Katto

    This topic has been closed for replies.

    3 replies

    Super User
    September 27, 2024
    Super User
    September 27, 2024

    Good video here on getting started with an STM32 Nucleo board:

    https://www.youtube.com/watch?v=hyZS2p1tW-g

     

    Super User
    September 27, 2024

    STM32CubeMX will provide the initialization code for you.

    You can see an example usage of I2C here:

    STM32CubeF4/Projects/STM32446E-Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/Src/main.c at e21c319e17a7f5aef332be677eaff2a0e7c316df · STMicroelectronics/STM32CubeF4 (github.com)

    Note that I2C requires external pullups of around 2.2kOhm on the SDA and SCL lines.