unalCe
Newbie level 3
Hey all!
I'm trying to improve myself on a STM32F407 Discoveryboard and I noticed something strange (for a newbie like me). I was simply blinking a LED on Port A pin 3. But I noticed some of other pins had some voltage on them too. Though I didn't configure them, by default they're configured as inputs.
While debugging I put a breakpoint after I set the pin 3 and checked GPIOA_IDR(Input Data Register) was 0x0000 86C8 and GPIOA_ODR(Output Data Register) was 0x0000 0008 as expected because I turned on the pin 3.
Pull-up/Pull-down register for GPIOA is 0x6400 0000 by default. Which means there should be no pull-up/pull-down on pin 9 for example.
The question is why I measured 4,68V(which is equal to 5v output on my mcu) on PA9,PA14,PA13 etc. Are they being used for something else in the background? Because I know these ports are not only used for GPIO. And if not is there something wrong with my mcu?
Hope this is not a waste of time for you.
Thanks in advance.
Unal
I'm trying to improve myself on a STM32F407 Discoveryboard and I noticed something strange (for a newbie like me). I was simply blinking a LED on Port A pin 3. But I noticed some of other pins had some voltage on them too. Though I didn't configure them, by default they're configured as inputs.
While debugging I put a breakpoint after I set the pin 3 and checked GPIOA_IDR(Input Data Register) was 0x0000 86C8 and GPIOA_ODR(Output Data Register) was 0x0000 0008 as expected because I turned on the pin 3.
Pull-up/Pull-down register for GPIOA is 0x6400 0000 by default. Which means there should be no pull-up/pull-down on pin 9 for example.
The question is why I measured 4,68V(which is equal to 5v output on my mcu) on PA9,PA14,PA13 etc. Are they being used for something else in the background? Because I know these ports are not only used for GPIO. And if not is there something wrong with my mcu?
Code:
GPIO_InitTypeDef GPIO_InitStruct;
/* GPIO Ports Clock Enable */
__GPIOA_CLK_ENABLE();
/* GPIO Configuration */
GPIO_InitStruct.Pin = GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
// GPIO_InitStruct.Pull = GPIO_PULLUP; // Not necessary for outputs
GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Hope this is not a waste of time for you.
Thanks in advance.
Unal