Skip to main content
Vkato.1
Visitor II
August 25, 2020
Solved

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 ?

  • August 25, 2020
  • 2 replies
  • 904 views

i am using STM32F103c8 MCU

This topic has been closed for replies.
Best answer by TDK

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.

2 replies

KnarfB
Super User
August 25, 2020

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.

TDK
August 25, 2020

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
TDKBest answer
August 25, 2020

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""."