Skip to main content
TARHAN SAMAH
Senior
September 19, 2017
Question

PULL UP DOESNT WORK ON stm32F100RB

  • September 19, 2017
  • 2 replies
  • 650 views
Posted on September 19, 2017 at 09:44

Hello , i try to make a program scanning a keypad 4*5 with stm32F100RB so i have to use 5 inputs as pull up (using internal resistor of the mcu ),

after initiating with cube i got this 

/*Configure GPIO pins : K1_IN_Pin K2_IN_Pin K3_IN_Pin K4_IN_Pin

K5_IN_Pin */

GPIO_InitStruct.Pin = K1_IN_Pin|K2_IN_Pin|K3_IN_Pin|K4_IN_Pin|K5_IN_Pin;

GPIO_InitStruct.Mode = GPIO_MODE_INPUT;

GPIO_InitStruct.Pull = GPIO_PULLUP;

HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

, after compiling and programming and i didnt connect any resistors of course ,, at the start up i mean before any application my pins gives 0v ???? is it normal it should give 5v (or 3,3v)  ...why is that ??

what should i add more to have the pull up .

for information i use these pins    PB1 B2 B10 B11 B12 ..

THANKS PLZ URGENT ADVİCE ME WİLL BE APPRECİATED 

Doumandji Samah Ayluçtarhan 

R &D ENGİNEER at Argebilisim Turkey 

    This topic has been closed for replies.

    2 replies

    Vangelis Fortounas
    Associate II
    September 19, 2017
    Posted on September 20, 2017 at 00:55

    Hi Tarhan!

    The code you provided is not enough for someone, to find the solution.

    This code is ok.

    Check, if  HAL and clocks correctly Initialized,  if __HAL_RCC_GPIOB_CLK_ENABLE() macro called before HAL_GPIO_Init

    check also if other code executed after GPIO initialization modifies the behaviour of theese pins.

    Regards

    vf

    TARHAN SAMAH
    Senior
    October 12, 2017
    Posted on October 12, 2017 at 08:22

    thanks for your answer ,