cancel
Showing results for 
Search instead for 
Did you mean: 

UART Rx GPIO Mode

apatel
Associate II
Posted on May 06, 2012 at 21:16

Hi

I've seen quite a few UART examples, and all of them set the RX GPIO pin as ''Input-floating''.

Why is it not set to ''Push-Pull'' (which can sink and source current)? The Tx pin is set to push-pull. What is the difference?

Thanks in advance

Amir

#stm32-gpio-mode
3 REPLIES 3
apatel
Associate II
Posted on May 06, 2012 at 21:29

I've also seen SPI examples and the SPI GPIO pins are set to push-pull.

Why would UART and SPI be different?

alok472
Associate II
Posted on May 07, 2012 at 04:17

You are mixing Input mode and Output mode of IO.

The Transmission pin of the MCU needs to be in PP out and Receiving pin has to be in Input Floating mode to let the Tranmitting pin drive the Rx pin of the MCU

Andrew Neil
Evangelist III
Posted on May 07, 2012 at 16:41

''UART examples, and all of them set the RX GPIO pin as 'Input-floating'.''

The clue is in the name: Input.

''Why is it not set to 'Push-Pull'?''

An Input  receives a signal driven by some other device; Push-Pull is for use as an output to drive another device!

''The Tx pin is set to push-pull''

Yes - because Tx is an output, so it needs to drive another device!

This is general - apart from the particular names, it is not specific to the STM32.