STM32H747 PA0_C & PA1_C input reading issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-05 1:15 PM
Hello,
I am working with a STM32H747XI. I have connected a digital input on PA0_C & PA1_C.
I used CubeMX for the initialisation.
The initialisation code is :
/*Configure GPIO pins : UI_ENC0_Pin UI_ENC1_Pin */
GPIO_InitStruct.Pin = UI_ENC0_Pin|UI_ENC1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
When I read the pin, it stays always at 0 (GPIO_PIN_RESET)
bpState1 = HAL_GPIO_ReadPin(GPIOA, UI_ENC0_Pin);
bpState2 = HAL_GPIO_ReadPin(GPIOA, UI_ENC1_Pin);
The pin PA0 is at " Reset State".
I dont know what I have to do to solve it.
Many thanks for your help.
Bertrand
Solved! Go to Solution.
- Labels:
-
STM32CubeMX
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-10 1:17 PM
Hello,
Sorry for the late feedback.
It works!
Many thanks.
Should I report as a bug for CubeMx?
Bertrand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-06 6:46 AM
Hello Bertrand,
are the analog switches between PA0 & PA0_C and PA1 & PA1_C closed?
HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PA0, SYSCFG_SWITCH_PA0_CLOSE);
HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PA1, SYSCFG_SWITCH_PA1_CLOSE);
Jaroslav
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-06 7:10 AM
I will check and try and revert to you.
Thank you.
Bertrand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-10 1:17 PM
Hello,
Sorry for the late feedback.
It works!
Many thanks.
Should I report as a bug for CubeMx?
Bertrand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-21 7:32 AM
Hello Bertrand,
I'm glad it worked. Concerning the CubeMX bug, I will take care of it.
Jaroslav
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
