Skip to main content
Visitor II
July 8, 2024
Question

Interfacing ADT7420 with STM32F411 MCU

  • July 8, 2024
  • 1 reply
  • 1228 views

i'm interfacing ADT7420 with STM32F411.

As per datasheet of ADT7420 the i2c specifications are as follows:

Table 2.

SCL Frequency 0 - 400 kHz

SCL High Pulse Width, tHIGH 0.6 μs

SCL Low Pulse Width, tLOW 1.3 μs

 

Therefore as per my understanding the i2c all operate in fast mode.

However, my doubt is related to duty cycle, the options available for i2c in stm32f411 are:

Tlow/Thigh=2

or

Tlow/Thigh=16/9

 

which option i have to use here

 

My code setting for i2c initilization are as follows

hi2c1.Instance = I2C1;

 hi2c1.Init.ClockSpeed = 40000;

 hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;

 hi2c1.Init.OwnAddress1 = 0;

 hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;

 hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;

 hi2c1.Init.OwnAddress2 = 0;

 hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;

 hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;

 

regards

    This topic has been closed for replies.

    1 reply

    Super User
    July 8, 2024

    >which option i have to use here

    Try with Tlow/Thigh=16/9 first .

    And speed : Init.ClockSpeed = 40000; ? Try standard first, 100 k . 400k is next step...

    And enable the noise filter(s) .

    NSing.5Author
    Visitor II
    July 8, 2024

    And enable the noise filter(s) .

    plz tell me how to enable filters for i2c

    Super User
    July 8, 2024

    AScha3_0-1720464195844.png

    here analog filter on, + dig.filter : if you wanna use, just set it: 0...15 possible.