Skip to main content
Ethan1
Associate II
April 20, 2022
Question

why stm32f407 usart config rx as otype PP. It is input use.I read RM0090, don`t know why.

  • April 20, 2022
  • 3 replies
  • 955 views

..

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
April 20, 2022

I don't know what's "otype PP". If you are using some Cube/HAL/LL or SPL terminology, note, that it's misleading (it comes from the STM32F1xx era, which are different than all other STM32 families are) and only what's written actually into GPIO registers matters.

If a pin is set to AF in GPIOx_MODER, its "direction" (or more precisely, whether output drivers are enabled or not) is determined by the module. If it's set as "input", i.e. output drivers are turned off (as is the case of UART Rx pins), then the setting of register determining the output behaviour (i.e. GPIOx_OTYPER) is irrelevant. Also the setting of GPIOx_ODR is irrevelant, as it is used only if the pin is set to Out in GPIOx_MODER.

Setting of GPIOx_PUPDR still applies.

JW

Ethan1
Ethan1Author
Associate II
April 21, 2022

I don`t speak good English.Yes,when I learned F1, the RM book has a table to tell me usart tx is AF_PP rx is Floating_IN, so F4 is totally different.

Also the setting of GPIOx_ODR is irrevelant, as it is used only if the pin is set to Out in GPIOx_MODER

as you said up.I read the RM, I think GPIOx_ODR is irrevelant whether the pin is set to Out or not, because ODR is not connected to output control. What do you think. I get it right?0693W00000LyXhCQAV.png

waclawek.jan
Super User
April 21, 2022

 > I get it right?

If pin is set to AF (Alternate Function) in GPIO_MODER, yes.

JW