I2C2 doesn't work
- August 13, 2021
- 2 replies
- 1033 views
Hello,
I am working with a custom board, using STM32F105VC.
The board has some LED drivers, which they use I2C1 and I2C2.
I2C1 works fine but I2C2 doesn't work. Configuration for both I2C are the same.
hi2c2.Instance = I2C2;
hi2c2.Init.ClockSpeed = 100000;
hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
hi2c2.Init.OwnAddress1 = 0;
hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c2.Init.OwnAddress2 = 0;
hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
if (HAL_I2C_Init(&hi2c2) != HAL_OK)
{
Error_Handler();
}
Do I need to enable something else?
In clock configuration, there is no setting for I2C1 and I2C2 peripherals. Why? (picture is attached)
Anyone can help me?
Thank you.
