cancel
Showing results for 
Search instead for 
Did you mean: 

PC3_C as input

BAl K.1
Associate III

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);

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal
2 REPLIES 2
LCE
Principal

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
Principal

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.