Skip to main content
Visitor II
February 1, 2017
Question

GPIO_ExternalPullUpConfig

  • February 1, 2017
  • 1 reply
  • 869 views
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?

    This topic has been closed for replies.

    1 reply

    Visitor II
    February 18, 2017
    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