cancel
Showing results for 
Search instead for 
Did you mean: 

hi sir How to check which GPOI pin is associated with I2C1 or USART1? question no2=> if USART use GPIO pin PA9 as USART_TX pin , then if i code to turn on LED on PA9 on different project will it work ?

Vkato.1
Associate

i am using STM32F103c8 MCU

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

CubeMX will give pins for each peripheral. You can also check the datasheet.

PA9 cannot be a GPIO pin and USART_TX at the same time, but your program can switch between the two functions as needed.

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

View solution in original post

3 REPLIES 3
KnarfB
Principal III

Its hard to answer without knowing the software you are using. At runtime you can look at the registers to find out how a pin is configured. See the "reference manual" for you chip family MODER register and more.

2nd: the pin function can be reconfigured on-the-fly by the code running. So, yes you can switch as you need, supposedly the pin is connected to suitable external components.

The STM32F1 family doesn't have a MODER register. Remapping is handled on a peripheral basis.

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

CubeMX will give pins for each peripheral. You can also check the datasheet.

PA9 cannot be a GPIO pin and USART_TX at the same time, but your program can switch between the two functions as needed.

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