2016-04-29 03:19 AM
Hello
I have question about i2c. My mcu i2c pin connect to i2c pin evaluation board BU945 My i2c init like thisI2C1Handle.Instance = I2C1;
I2C1Handle.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
I2C1Handle.Init.Timing = I2C_TIMING_100KHZ;
I2C1Handle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
I2C1Handle.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
I2C1Handle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
I2C1Handle.Init.OwnAddress1 = 0x00;
I2C1Handle.Init.OwnAddress2 = 0x00;
if(HAL_I2C_Init(&I2C1Handle) != HAL_OK)
{
/* Initialization Error */
//Error_Handler();
}
I try to send HOME command 4 byte {0x61,0x03,0x01,0x01} slave address is 0x
But when transmit it always return error
HAL_I2C_ERROR_AF.
Could someone help me please ?
Thanks
#i2c
2016-04-29 10:38 AM
Hi _.adri,
you are missign to fill the I2C_address on the ''OwnAddress1''.I recommend to check the I2C example in at this path:STM32Cube_FW_L0_V1.5.0\Projects\STM32L053C8-Discovery\Examples\I2C-Hannibal-