cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx I2C ack bit voltage level problem

simon239955_stm1_st
Associate II
Posted on June 25, 2015 at 14:57

Hi

I'm trying to get the STM32F427 I2C module (using I2C2) to communicate with a slave device and when I send a start bit followed by the slave address I can see that the slave device is trying to acknowledge on an oscilloscope but the voltage level only gets pulled down from 3.3 volts to about 2 volts.

I tried an alternate I2C communication using GPIO open collector outputs and ''bit-banging'' the I2C lines and then the same slave device can pull the line down to 0 volts. As bit banging works I don't think the problem is the device or the I2C pull up resistors.

When I use the internal I2C module do I need to setup the I2C GPIO pins for anything extra than my current setup of:

1. Set pin PB10 to alternate function.

2. Set pin PB11 to alternate function.

3. Remap PB10 alternate function to AF4.

4. Remap PB11 alternate function to AF4.

The problem looks like the PB11 pin (I2C2_SDA2) is trying to drive the SDA line when the slave device is trying to ack. The number of SCL pulse is correct and the last one is for the ACK bit.

Any suggestions or advice is appreciated.

Regards

Simon
2 REPLIES 2
Posted on June 25, 2015 at 15:03

Missing configuration code.

Make sure you're programming the pins in Open-Drain mode, not Push-Pull. Would suggest external 4K7 pull-ups.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
simon239955_stm1_st
Associate II
Posted on June 25, 2015 at 15:09

Thanks that has fixed it. I needed to set the outputs to open drain and now it is working. I incorrectly assumed setting the pins as I2C alternate function would do that for me.