cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO_ExternalPullUpConfig

akdoganahmet
Associate
Posted on February 01, 2017 at 09:53

 What is the difference GPIO_ExternalPullUpConfig (GPIOB, GPIO_PIN_0, ENABLE) and GPIO_Init(GPIOB,GPIO_PIN_0,GPIO_MODE_IN_PU_NO_IT) in point of P-Buffer FET (FET at high side) and internal pull-up resistor. In an other saying: What does 

GPIO_ExternalPullUpConfig control? P-Buffer FET (FET at high side) or internal pull-up resistor?

1 REPLY 1
Szymon PANECKI
Senior III
Posted on February 18, 2017 at 15:15

Hello,

The key difference between GPIO_ExternalPullUpConfig() and GPIO_Init() is that the first function configures only pull-up resistor for GPIO and the second function configures complete set of GPIO options: input/output mode, pull-up/float, push-pull/open-drain, interrupt and slope.

However regarding pull-up resistor these two functions do exactly the same thing. They both refer to GPIO CR1 register, which stands for GPIO Control Regiser 1. This register is responsible for enabling or disabling pull-up register when GPIO is in input mode.

To see how GPIO CR1 controls pull-up resistor please refer to MCU reference manual, chapter named ''General purpose I/O ports (GPIO)'' and figure named ''GPIO block diagram''. GPIO CR1 controls gate of P-BUFFER FET transistor, which switches on/off GPIO pull-up resistor.

0690X00000606LsQAI.png

Best regards

Szymon