2025-11-25 8:35 PM
Hi,
I’m working on an STM32G491 MCU and facing an issue with GPIO PB9.
In my project, I initialize PB9 as a digital output and try to set it HIGH, but the pin always stays LOW on the board.
However, if I configure PB9 as input and toggle the pin externally in the same circuit, I can read HIGH and LOW correctly.
Why would PB9 not go HIGH when configured as output? What could be the possible reasons or things to check?
2025-11-25 10:29 PM
Nobody on this forum has a crystal ball, so you should post the relevant code.
There is even a specific editor menu point for that ('</>').
> Why would PB9 not go HIGH when configured as output?
Have you checked the schematics of your board ?
Other hardware at that pin might interfere.
Is the peripheral clock for GPIOB enabled ?
> ... and try to set it HIGH, but the pin always stays LOW on the board.
The STM32 GPIOs have separate registers for input and output, and separate output registers to set or reset pins.
Share the relevent code.