2017-09-19 12:44 AM
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
2017-09-19 03:55 PM
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
2017-10-11 11:22 PM
thanks for your answer ,