2015-04-05 03:26 PM
Hello,
I try to find some topick with same problem. But every topick is without the solution of problem.I have problem with I2C in 95% (yep, sometimes it works, after restart, it not work). I try to comunicate with STMPE811 via I2C. I setup GPIOs for I2C3 (PA8 and PC3) and I2C3 timing.// Configure I2C3 (100kHz standard)
I2C3->CCR =0xD9
;// Clock control - Th&Tl = CCR*PCLK => 5us
I2C3->CR2 |= (APB1clk /1000000
);// Freq of APB1 in MHz
I2C3->CR1 |= I2C_CR1_ACK;// Acknowledge returned after
I2C3->OAR1 |=0x4000
;// Bit 14 Should always be kept at 1 by software. ?????? WTF!? OK, But why?
I2C3->TRISE = (APB1clk /1000000
) +1
;// Rise time = 1000ns
// Enable peripheral
I2C3->CR1 |= I2C_CR1_PE;// Enable peripheral
Next I tryed to read an ID from STMPE811. I set bit START in CR1 and wait for SB bit.// Generate start condiction
I2C3->CR1 |= I2C_CR1_START;while(!(I2C3->SR1 & I2C_SR1_SB))// Wait to SB
Voltages on lines are: SDA 0.1V SCL 3.05VBut SB bit is not set, never. It always is stuck in cycle.Can someone help with it?Thanks for any response. #i2c #stm32f429discovery #touchpad2015-04-21 12:43 PM
Hello, I have the same problem. Did you manage to solve it?
Thank you.Fernando