Skip to main content
marcogrossi89
Associate III
January 20, 2025
Question

Pull-up and Pull-down resistors in STM32 microcontrollers

  • January 20, 2025
  • 3 replies
  • 1830 views

Hello everyone,

I have carried out some experiments on five different STM32 microcontroller devices (STM32F103) measuring the values of the pull-up and pull-down resistances integrated in the GPIO. I have created a voltage divider between VDD and ground using the internal pull-up and pull-down resistors and an external reference resistor. I have found that the value of pull-down resistors are slightly lower in value than the pull-up resistors on all tested devices and their value is less stable than the pull-up resistances.

Anyone knows how the pull-up and pull-down resistors are effectively implemented in the GPIO microcontroller? Are these real resistors with a switch in series or something else? Are the pull-down resistances implemented in the same way as the pull-up resistances?

Thanks.

Marco

 

This topic has been closed for replies.

3 replies

gbm
Super User
January 20, 2025

There are no resistors, just transistors with high channel resistance. The are not supposed to be accurate or stable.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
marcogrossi89
Associate III
January 21, 2025

Thanks for the information.

Do you know if there are differences in the implementation of pull-up and pull-down resistors, that is, for example, pull-up are implemented using p-MOSFET and pull-down using nMOSFET?

Is the pull-up/pull-down implementation inside a microcontroller a standard? Or it can change for different microcontroller manufacturers?

Since pull-up/pull-down resistors are not real resistors, is it expected that the measured resistance change significantly with the voltage value on the pin (i.e. with the current drawn by the transistor or its drain-to-source voltage)?

Best regards.

Marco

 

Andrew Neil
Super User
January 21, 2025

As @gbm said, the internal pull ups/downs are not supposed to be accurate or stable - so if any of those things matters in your application, you should be using suitably-defined external pull ups/downs.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.