cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f051C6 PF6/7 AF for I2C

jgnoss
Associate III
Posted on February 26, 2013 at 07:38

Hello, I try to make I2C on PF6/7 on the STM32F051C6  (48 Pin device) working.

To get what AF to use, Ref man points to the datasheet. But the datasheet is not clear to me, it has a AF Table for PortA and PortB

and  Table 13 Pin definitions  says

PIN 35 - - PF6 I/O FT I2C2_SCL

PIN 36 - - PF7 I/O FT I2C2_SDA

I tried AF0 and AF1 but the chip let me in the dark.

The code I have is working on the STM32F0-discovery

with I2C1 on PB6/7.

Any ideas?

Ju

#i2c-stm32f051c6
5 REPLIES 5
Posted on February 26, 2013 at 16:10

I tried AF0 and AF1 but the chip let me in the dark.

The chip only supports GPIOx_AFRL/H on ports A and B so doing anything of port F would be impossible/inadvisable.

Just set the pins in AF mode, and don't change the PinSource muxing.

Set the pins as OD, and use external pull-ups.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jgnoss
Associate III
Posted on February 26, 2013 at 16:57

clive1 you are my hero.

I got it working on the discovery. Now I have to make it work on my PCB. No big deal I guess.

But can you tell me where you got this info from, that GPIOx_AFRL/H only works on Port A and B.

Or is this just interpretation because of missing AF table to other ports?

Ju

Posted on February 26, 2013 at 17:24

But can you tell me where you got this info from, that GPIOx_AFRL/H only works on Port A and B.

It's marked in a couple of places in the reference manual in terms of scoping when the registers are valid.

0690X000006053OQAQ.png

0690X000006052zQAA.png
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jgnoss
Associate III
Posted on February 26, 2013 at 18:00

OK, got it.

We never stop learning.

thanks a lot to you clive1

Nickname925_O
Associate II
Posted on November 22, 2013 at 16:41

Ho gnoss,

please, can you share your I2C code for STM32F0?

Thanks a lot in advance,

Peppe.