cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 I2C SDA & SCL rise time

gil23
Associate III

Hi,

I working with STM32F401RET6 64 pins Nucleo board with IAR.

According to the datasheet DM00086815 Section 6.3.19 SDA and SCL rise time = 300ns.

I open the project from “STM32Cube_FW_F4_V1.25.0�? STM32F410xx-Nucleo\Examples\I2C\I2C_TwoBoards_ComPolling.

I change the clock setting to fit my board to get: SYSCLK(Hz) = 84MHz & Fpclk1 = 42MHz.

I connect my probes direct to board pins PB6 & PB9.

Then I measured and I get that 0693W000006EojXQAS.jpg SDA and SCL rise time = 1.2us.

Attached oscilloscope picture.

I tried to change configuration to  “GPIO_InitStruct.Speed    = GPIO_SPEED_HIGH�? but I didn’t see any change.

Please advise.

The configuration of the clock that I change :

 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;

 RCC_OscInitStruct.HSIState = RCC_HSI_ON;

 RCC_OscInitStruct.HSICalibrationValue = 16;

 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;

 RCC_OscInitStruct.PLL.PLLM = 16;

 RCC_OscInitStruct.PLL.PLLN = 336;

 RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;

 RCC_OscInitStruct.PLL.PLLQ = 4;

 HAL_RCC_OscConfig(&RCC_OscInitStruct);

 RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK|RCC_CLOCKTYPE_PCLK1;

 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;

 RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;

 RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;

 RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

 HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);

6 REPLIES 6

I2C signals are driven by Open-Drain transistors, and their rise time is given by pullup resistors you are supposed to add externally.

The internal pullup is nominally cca 40kOhm, which may be sufficient only if the load is of low capacitance.

JW

TDK
Guru

The datasheet measurements are taken with a 4.7kOhm pullup resistor. Guessing you don't have any.

0693W000006ErDZQA0.png

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

Thanks, it's woks,

I connect 4.7K pullup and the rise time is 100ns

gil23
Associate III

Hi,

Problem didn't solve completely,

I connect another STM32F401RET6 board, and I configured it with the same project only as a slave.

I connect 4.7K pullup between master board to slave board.

the rise time is now 550ns.

Please advise.

Attached oscilloscope picture.

0693W000006FIoDQAW.jpg

TDK
Guru

(ignore)

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

The risetime is simply given by RC constant. 550ns/4k7=cca 110pF, not an entirely unreasonable value, especially if you connect two boards with lengthy cables.

You can decrease the pullup's value, taking into consideration the maximum allowable pin current.

JW