cancel
Showing results for 
Search instead for 
Did you mean: 

F103C8T6 GPIO pins and their alternate functions.

MLAOU.1
Associate

Hi all,

recently I started playing with an STM32F103C8T6 based minimal dev board (BLUE PILL), it's a powerfull and complicated beast and the ST RM0008 Reference manual is 1134 pages, not really encouraging for beginners like me!!

The pinouts found on the net have some mistakes concerning the alternate functions.

So I want to write a guide about GPIO pins and their alternate functions to understand their work and help others getting started easily.

I want this guide to be:

1- Simple and concise: but as detailed and complete as possible.

2- Intuitive and logicaly ordered: from the reset to remapping.

The guide will be organised in two parts:

- A quick start part.

- A detailed part.

We will say:

What are the eclectrical characteristics:

 - Fan-in and fan-out, how to boost sink and source courant? how to drive 5V circuits?

 - what 5v volt tolerant means?

 - Max frequency? input/output capacitance?

 - Clones electrical characteristics, better or worse?

How to configure the ports and how to remap functions:

 - Using direct access to registers.

 - Using CMSIS functions.

If u can help with accuarate information from trusted sources or from ur own experience, or if u know some related ressources on the web please let me know, I'll be very grateful.

Please keep this thread only for pin functions not the functions them selves.

for example: we don't bother how USART1 uses PA9 as a TX pin, our intereset is how to config the pin to use this function or how to remap this function to an other pin if possible.

Voilà!

First, i've a couple of questions:

 1- If a pin dafaults to many functions ( PB12: UART1-CK, TIM1-BKIN, SPI2-NSS ) and these periherals are all enabled in the same time, is there any sort of priority? what is the preiority if any? Is there a possible conflict?

2- I've connected a USB-to-COM to the board like this:

 USB-to-COM    STM32 BOARD

  RX            PA2 (TX)

  TX            PA3 (RX)

  GND           GND

I've NOT connected the +5V from USB-to-COM to the +5V on the board.

Even when the board is not powered, when I plug the USB-to-COM in the PC the 2 LEDs on the board light !!!

The same thing when I connect TX (from USB-to-COM) to some other pins.

What do u think?

Thanks

2 REPLIES 2
TDK
Guru

> The pinouts found on the net have some mistakes concerning the alternate functions.

Trust the reference manual and datasheet over internet posts.

The reference manual is long, but that's because the chips are complex. You don't need to read the entire thing, just read the part you're interested in. The datasheet is also a useful resource and contains more chip-specific information.

> What are the eclectrical characteristics:

You can find the GPIO pin characteristics such as max frequency in the datasheet.

> If a pin dafaults to many functions ( PB12: UART1-CK, TIM1-BKIN, SPI2-NSS ) and these periherals are all enabled in the same time, is there any sort of priority? what is the preiority if any? Is there a possible conflict?

You can only assign a single alternate function to a pin, so there cannot be a conflict because of this.

If you feel a post has answered your question, please click "Accept as Solution".
MLAOU.1
Associate

Thanks TDK for ur quick reply and for ur advices.

I'm trying to summarize all the information relative to GPIOs and their alternate functions.