1
\$\begingroup\$

I started designing the development board for STM32F427VIT6 of LQFP100 package. Its has multiple USART and UART pins.

The USART names in the datasheets are USART1, USART2, USART3, UART4, UART5, USART6 UART7 and UART8.

In pin out table pin PA0 and PA1 are UART4_TX and UART4_RX respectively. PC10 and PC11 are also UART4_TX and UART4_RX. Same case with USART and SPI pins. Different pins having the repeated names.

Please explain the reason and how to use these pins.

\$\endgroup\$
  • 1
    \$\begingroup\$ You use those pins by programming the right functionality in your IO maps. \$\endgroup\$ – Andy aka May 13 at 11:40
  • \$\begingroup\$ Any special reason of giving the same functionality names to different pins? \$\endgroup\$ – PCBLearner182 May 13 at 11:45
  • 3
    \$\begingroup\$ Because UART4 can be routed to different pins. It doesn't mean it's a typo - if you have UART4 assigned to certain pins and then again to some other different pins (if that is possible) you don't suddenly get an additional independent UART. \$\endgroup\$ – Andy aka May 13 at 12:00
  • \$\begingroup\$ Means, it is a kind of parallel configuration? Any one configuration (PA0 and PA1 or PC10 and PC11) from these pins can be used ? \$\endgroup\$ – PCBLearner182 May 13 at 12:32
  • 1
    \$\begingroup\$ @PCBLearner182 or even PA0 with PC11 \$\endgroup\$ – berendi May 13 at 14:31
1
\$\begingroup\$

What helps me a lot is to install STM32Cube (nowadays called STM32CubeIDE). There you can select all peripherals you need, and you can very easily find out which peripherals clash (i.e. use the same pins) and use alternative options.

Using alternate (such as PC10/PC11) pins for UART4 you have to select manually within the graphical layout, but this is much faster than trying to read datasheets.

It can generate the framework code in case you want to use HAL, but even if you would not want, it helps to find out easily how to check the pins which you can use.

Below you see a picture from your CPU with the UART4 at alternate pins:

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Thank you for suggesting this tool. \$\endgroup\$ – PCBLearner182 May 13 at 12:41
3
\$\begingroup\$

There are a bunch of muxes inside the chip which allow you to route signals to different pins to allow for easier part placement and PCB layout.

The GPIO peripheral then has alternate function registers to select which function to give to which pins, these registers configure the muxes.

\$\endgroup\$
0
\$\begingroup\$

You'll need to set the GPIO port to alternate function and then select the usart alternate function through the gpio alternate function register.

Further more there is another register were you can pick alternate pins for the same peripheral ..i.e. usart 4.

Have a read through the Reference Manual for your specific Chip

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.