cancel
Showing results for 
Search instead for 
Did you mean: 

PULL UP DOESNT WORK ON stm32F100RB

TARHAN SAMAH
Senior
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 

2 REPLIES 2
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
Posted on October 12, 2017 at 08:22

thanks for your answer ,