Hello. I'm developing an application based on Discovery board with stm32f429I.
And now I have quite a weird issue: a high signal level is shown on unconnected input pins.
Here is a code:
//Configure PC4 = input
#define GPM_IN ((uint32_t) 0x00000000) /*GPIO_Mode_IN*/
#define GPb04 8
#define GP_HiSpd ((uint32_t) 0x00000003)/*GPIO_High_Speed*/
GPIOC->PUPDR=( (GPIO_PUPDR_PUPDR4_1) );
I have tried different parameters of pullup and pulldown resistors, referring the following:
but the issue persists, IDR4 bit shows '1' in debugger, while I'm expecting it to be 0. Strangely, but a similar configuration works OK for other ports. I have checked in debugger, nothing rewrites PC4 configuration, MODER4 is 0 as it should be. I suppose that for GPIO input I should enable pulldown resistor because it links input to Ground, which is believed to be as source of zero and use push-pull mode, because StackOverflow answer states that opendrain mode is used with pullup resistor...
How to correctly configure GPIO for input?