cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO pull - up/down configuration

akinik
Associate
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

3 REPLIES 3
zzdz2
Associate II
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
Associate
Posted on December 17, 2012 at 14:05

Thank you very much

mahmoud_dhaiwi
Associate II
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 .