cancel
Showing results for 
Search instead for 
Did you mean: 

How to select a particular peripheral for a pin on F107

DiBosco
Senior
Posted on September 05, 2016 at 19:46

Folks,

Can't see anything in the user manual about this. With the Atmel M3/M4s if you have a pin that has multiple uses such as UART/Timer/Ethernet there's a register to program that selects which of the peripherals will be routed to the pin.

On the STM32 I can see no such register. So, for example, on the F107, PB10 can be I2C, USART3 or Ethernet. How does one choose the appropriate function please?

Thanks!

Rob
5 REPLIES 5
mark239955_stm1
Associate II
Posted on September 06, 2016 at 02:36

Perusal of the

http://www.st.com/resource/en/reference_manual/cd00171190.pdf

(currently v16), ch9 GPIO, and ch9.4, AFIO, should tell you what you need to know.

Posted on September 06, 2016 at 03:59

The F1 is the earliest design and the AF options are rather limited compared to newer design

The F1 map at a peripheral level and effect a group of pins. A different group of pins can selected by remapping the peripheral, there may be 2 or 3 options.

The Data Sheet is where to look at pin/peripheral choices.

Newer designs (F2, F3, F4) allow for pin level mapping, where there can be up to 16 choices on each pin, usually the choices are a subset of the 16.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
DiBosco
Senior
Posted on September 06, 2016 at 11:48

Thanks for the replies, folks.

@markt, I have (and had already) looked through those sections over and over and I cannot see any reference to this information at all.

@Clive, I am aware of the remapping thing, but I'm not talking about remapping here.

Maybe I am being slow or missing something, but if I go back to the original example, the default function for PB10 is I2C2_SCL, USART3_TX and ETH_MII_RX_ER. This seems to be nothing to do with remapping, but possible uses for that pin.

To return to the Atmel example, there is register you set to route which of the possible peripherals has access to that particular pin. Even going back to the pages once more as markt suggests, I just cannot see anything vaguely connect to this.

I can see one region that says if you use Ethernet, the I2C is disabled, but nothing about what might happen to USART3 if Ethernet is used.

So, I am still none the wiser as to how you route the USART through to the pin as opposed to the Ethernet peripheral.

Thanks!
Posted on September 06, 2016 at 13:15

Not everything can be escaped.

If you enable USART3 it will own the AF control of the pin. If you enable Ethernet too they will fight/clash, and you'd need to remap USART3 to a different group of pins to escape Ethernet cleanly here.

Getting a workable set of pins and peripherals can be a challenge

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
DiBosco
Senior
Posted on September 06, 2016 at 13:31

Ah, now I understand! Excellent, thank you!