cancel
Showing results for 
Search instead for 
Did you mean: 

Pin versus port in STM32Cube example

lekanteto
Associate
Posted on December 04, 2014 at 01:32

I changed the pins in the UART_TwoBoards_ComPolling example for the Nucleo STM32L152RE board.

It did not work until i also changed the port. Is there a fixed connection between pin and port? How do I know which pin belongs to which port?

#define USARTx_TX_PIN GPIO_PIN_6
#define USARTx_TX_GPIO_PORT GPIOB

#define USARTx_TX_PIN GPIO_PIN_9
#define USARTx_TX_GPIO_PORT GPIOA

2 REPLIES 2
Posted on December 04, 2014 at 03:15

How do I know which pin belongs to which port?

Well there's a data sheet that associates all the pins with all the peripherals, perhaps that would be a good place to start?

http://www.st.com/web/en/catalog/mmc/SC1169/SS1295/LN962/PF259539

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00098321.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
lekanteto
Associate
Posted on December 04, 2014 at 14:11

Thanks for your anwer. I had already looked at that document.

Now that I have thought some more about it I figured out that the second letter of the pin name equals the port name.

e.g. pin name PB6 means pin 6 and port B.