cancel
Showing results for 
Search instead for 
Did you mean: 

I2C question ?

antonius
Senior

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

0690X000009YiLbQAK.jpg

0690X000009YiLgQAK.jpg

11 REPLIES 11
antonius
Senior

from register, it looks like it's going to SMBUS mode, I didn't change that ??

I got it work already, I put the wrong I2C address for it...suppose to be 7E, I put 4E, thanks a lot....