Skip to main content
Visitor II
September 27, 2024
Question

Trouble initializing the I2C interface

  • September 27, 2024
  • 3 replies
  • 717 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

    Andrew Neil
    Super User
    September 27, 2024
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    September 27, 2024

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

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

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    TDK
    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.

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