Skip to main content
akinik
Associate
December 17, 2012
Question

GPIO pull - up/down configuration

  • December 17, 2012
  • 3 replies
  • 995 views
Posted on December 17, 2012 at 11:17

Hi All,

CNF1 and CNF0 bits at port configuration register. 11 is reserved , 10 makes it pull - up/ down.

I think it connects pull up and down resistor at same time.

Is it possible to select pull - up only.

Thanks

    This topic has been closed for replies.

    3 replies

    zzdz2
    Associate
    December 17, 2012
    Posted on December 17, 2012 at 11:47

    You can set it with ODR, just like GPIO output.

    When the output bit is '1' you have pull-up, if '0' then pull-down.

    akinik
    akinikAuthor
    Associate
    December 17, 2012
    Posted on December 17, 2012 at 14:05

    Thank you very much

    mahmoud_dhaiwi
    Associate II
    December 18, 2012
    Posted on December 18, 2012 at 09:35

    GPIO_InitTypeDef

    GPIO_InitStructure;

    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,

    ENABLE

    );

    GPIO_InitStructure.

    GPIO_Mode

    =

    GPIO_Mode_IPU

    ;

    GPIO_InitStructure.

    GPIO_Pin

    = GPIO_Pin_6;

    GPIO_Init(GPIOC, &GPIO_

    InitStructure

    );

    this is an example show how to configure pin 6 in port C as input pull up .