Skip to main content
BAl K.1
Associate III
July 18, 2023
Solved

PC3_C as input

I use PC3_C pin as an GPIO_Input, but when i debug it is flickering between 1 and 0 even without any connection to the pin. anyone knows what happened?

this is the setup i use

GPIO_InitStruct.Pin = Emergency_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PC3, SYSCFG_SWITCH_PC3_CLOSE);

    This topic has been closed for replies.
    LCE
    LCEBest answer
    Principal III
    July 18, 2023

    And check this:

    https://community.st.com/t5/stm32cubemx-mcu/stm32h723-pinout-pc2-c-pc3-c/td-p/155569

    BTW, always post the exact STM32 model you are using.

    2 replies

    LCE
    Principal III
    July 18, 2023

    This:

    > even without any connection

    combined with:

    > GPIO_InitStruct.Pull = GPIO_NOPULL;

    might lead to the "flickering".

    Activate the GPIO's pull-up or pull-down and see if it gets better.

    LCE
    LCEBest answer
    Principal III
    July 18, 2023

    And check this:

    https://community.st.com/t5/stm32cubemx-mcu/stm32h723-pinout-pc2-c-pc3-c/td-p/155569

    BTW, always post the exact STM32 model you are using.