2020-04-02 01:30 AM
hi, I am working with the NUCLEO-F207ZG card and I have configured USART2 on port D.
Now CubeMx offers me the setting of the RX pin in Push-pull mode !!!!!! The same for CTS !!!
And there is no way to set the pin in any other way !!!
Can anyone give me an explanation ???
Solved! Go to Solution.
2020-04-02 05:46 AM
Hello @Zano,
After check with STM32CubeMX V5.6.0, it is possible to select open-drain mode for USART2_RX (see my attached screenshot).
so, please update and use the latest version of STM32CubeMX.
Best Regards,
Imen
2020-04-02 04:30 AM
It's OK.
In the ST terminology push-pull apply also to input!
2020-04-02 05:46 AM
Hello @Zano,
After check with STM32CubeMX V5.6.0, it is possible to select open-drain mode for USART2_RX (see my attached screenshot).
so, please update and use the latest version of STM32CubeMX.
Best Regards,
Imen
2020-04-02 05:58 AM
Okay Imen, thanks for your answer,
but this is still wrong in my opinion, cube-mx continues to set the usart RX pin as if it were an output.
2020-04-02 06:04 AM
According to the reference manual, we can add the "Open Drain" mode option at alternate function:
"When the I/O port is programmed as alternate function:
• The output buffer can be configured as open-drain or push-pull"
2020-04-02 06:51 AM
Ah .... thanks Imen,
so this means that by configuring a pin as an alternate function and when the alternate function requires the pin to be an input (usart RX) then the output buffer is automatically disabled and its configuration is superfluous .....
This also means that I have to read the manual better before posting questions like this :D
2020-04-02 08:36 AM
You are right, when the alternate function (USART RX) this means that the output buffer is disabled.
In fact, when the USART is used in single wire half duplex, the pin must be configured as alternate function open drain (as it is used for transmission and reception). The same when the IP is used in Smartcard mode.
2020-04-08 02:01 PM
> In fact, when the USART is used in single wire half duplex, the pin must be configured as alternate function open drain (as it is used for transmission and reception).
Not necessarily. Even on half-duplex lines one can put a series resistor for safety and use push-pull mode. That will be more robust and faster connection compared to open drain and pull-up. That is actually used and recommended, for example for some stepper motor drivers:
https://cdn.instructables.com/FSV/CUMP/JHATJSN0/FSVCUMPJHATJSN0.LARGE.jpg
Instead of connecting Rx and Tx pins like in an image, on STM32 the same can be done by using half-duplex configuration with a single Tx pin in push-pull mode and a 1k series resistor.