2019-07-13 08:51 PM
Dear Members,
I tried to initialize I2C in STM32F107
but got the straight line on Logic Analyzer,
I have no idea why ????
The code
void test()
{
data_t[0] = 0x0C; //en=1, rs=0
data_t[1] = 0x08; //en=0, rs=0
data_t[2] = 0x0C; //en=1, rs=0
data_t[3] = 0x08; //en=0, rs=0
HAL_I2C_Master_Transmit(&hi2c1, 0x4E,(uint8_t *) data_t, 4, 100);
}
Is it by default in STM32CubeMX, the cpu acts as master ??
I tested PB7 and PB6, they are connected properly into my header pins...
I have no clue why...??
2019-07-14 09:16 PM
from register, it looks like it's going to SMBUS mode, I didn't change that ??
2019-07-15 08:55 PM
I got it work already, I put the wrong I2C address for it...suppose to be 7E, I put 4E, thanks a lot....