cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing ADT7420 with STM32F411 MCU

NSing.5
Senior

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

3 REPLIES 3
AScha.3
Chief II

>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) .

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

And enable the noise filter(s) .

plz tell me how to enable filters for i2c

AScha3_0-1720464195844.png

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

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