cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411RE PC13 user button mode is only pull-up?

MasterHans
Associate II

Hello ST community,

I can't find on the st.com website the documentation showing the electronic circuit of the STM32F411RE, especially for the user button. In which document can I find it?

On the web it seems that schematics from google image show that the user button on the STM32F411RE only has pull-up resistor. Is it true?

The pull-down mode when configured in MX_GPIO_Init() isn't working.

CU,

MH

 

schematics.png

 

 

 

6 REPLIES 6
gbm
Lead II

STM32F411RE is a microcontroller, not a board. You need to find the schematic of the board you have. Maybe this link will help you:

https://stm32-base.org/boards/

Andrew Neil
Evangelist III

As @gbm said, "STM32F411RE" is a microcontroller - not a board.

If you have an ST board, the schematics will be available on its Product Page; eg, for the NUCLEO-F411RE board:

AndrewNeil_0-1708688094969.png

https://www.st.com/en/evaluation-tools/nucleo-f411re.html 

Look on the 'CAD Resources' tab:

AndrewNeil_1-1708688127161.png

https://www.st.com/en/evaluation-tools/nucleo-f411re.html#cad-resources

Schematics are usually also included in the User Manual - see the 'Documentation' tab.

 


@MasterHans wrote:

On the web it seems that schematics from google image show ...

schematics.png


That is not an ST board - you'll have to contact the supplier or designer of that particular board with questions about it.

Do you actually have that board, or is it just a random image you found through Google?

You need to find the correct schematic for the board you actually have.

ST boards will have ST details bottom-right of each sheet; eg,

AndrewNeil_2-1708688490176.png

 

 

Yes, a pull-up OR a pull-down - never both at the same time.

Most of the time, with a simple push button (closing a circuit when pressed) "we" use a pull-up. It is there to avoid the input signal "floating" (unconnected) when the button is not pressed.

So, such a push button becomes "low active": if not pressed, MCU sees a 1 (hi), if pressed MCU sees a 0 (low). You can also configure a falling edge interrupt to realize when the button was pressed (the start, not the release).

If you have an external pull-up but you would enable an (MCU) internal pull-down - what happens?
It is a resistor divider! Now the signal level for this input signal "hangs somewhere in the middle" and it is not anymore a clear 0 or 1. (never both pull-x at the same time)

Pavel A.
Evangelist III

The button connected to PC13 is right in the middle of your picture. When the button is pressed, PC13 will be connected to the ground. Contact 2 of the button is pulled up with a resistor. So you configure PC13 as simple input with neither [internal] pull up or pull down.

 In which document can I find it?

AN4899

 

Yes, Pavel A. is right.
Basic stuff: just understand what a voltage divider via resistors is (pull-up and pull-down active at the same time), what happens if you connect two resistors in parallel, etc.

If there is an external pull-up - and it is on your board! - you should NEVER enable also an MCU internal pull-up: now you have two resistors in parallel and the resultant resistance is way lower (and can kill your MCU pin).

So, as Pavel A. has mentioned: in this case: NEVER enable a pull-up neither a pull-down inside MCU.


@tjaekel wrote:

Most of the time, with a simple push button (closing a circuit when pressed) "we" use a pull-up. It is there to avoid the input signal "floating" (unconnected) when the button is not pressed.


Indeed.

@MasterHans : But a pull-down (resistor to GND) could equally be used - with the button connecting to VDD.

In that case, it would be "active high":

  • if not pressed (inactive), MCU sees a 0 (low);
  • if pressed (active) MCU sees a 1 (high).

So, again, this is nothing to do with the STM32F411RE - it can work with either - it's all down to the external circuit, and how the designer of that external stuff decided  to do it.