cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO Alternate Input

avinash_elec
Associate III
Posted on July 25, 2016 at 14:34

When we setup a GPIO pin for Alternate function, their is only option for Alternate function output. Even if some alternate functions are actually input to the peripheral (like USART_RX, Timer Capture Input etc). Even in those case we have to configure them like Alternate Output Pushpull type. Why?

 

 

It seems like if we make them alternate function pushpul and default ODR value is 0, then it will pull down the level on the physical pin.

 

1 REPLY 1
Posted on July 25, 2016 at 18:52

Depends on the STM32 Family, but

In AF mode the peripheral controls the driver more directly, it can enable the input/output for bidirectional use cases.

The pin can be in OD or PP mode, depending on the signalling requirements.

The pin can have a pull up or down, or neither.

Flexibility is a good thing, review the pin-driver diagram, and don't try to overthink things, it is not that complicated.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..