cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with I2C on PA8 and PC9

markusherrmann9
Associate
Posted on July 10, 2014 at 11:41

Hello,

i tried to use I2C3 on PA8 and PC9. I noticed that i can send data over the i2c bus but the stop condition was not working.

So the bus never came back. After some investigation i found that the SCL line starts oscillating with 16MHz (I use the HSI oscillator).

I checked the RCC MCO settings and noticed that it is set to HSI output. When i change the prescaler i can change the frequency.

Since i use a STM32F407VGT6 i am not able to use alternative pins. Is there any workaround to avoid MCO to overtake the I2C lines?

 0690X00000604pnQAA.png

0690X000006058YQAQ.png

#stm32f407 #mco #i2c
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
waclawek.jan
Super User
Posted on July 10, 2014 at 12:28

> After some investigation i found that the SCL line starts oscillating with 16MHz

Under what circumstances does this happen?

What is the content of GPIOA_AFRH in that moment?

JW

markusherrmann9
Associate
Posted on July 11, 2014 at 13:36

Finally i got it working. The Problem was that i did the usb init after i2c init.

The usb init caused the pin mode change. After changing the init order everything works fine.
waclawek.jan
Super User
Posted on July 11, 2014 at 14:37

> The usb init caused the pin mode change.

Why would USB init set MCO output?

Is the USB init your code or some library?

JW