Resetting a GPIO PIN INPUT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-18 9:01 AM
Hello guys,
I am using pin PC7 set has input on ahttp://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260320
and use IAR with . __HAL_RCC_GPIOC_CLK_ENABLE(); GPIO_InitStruct_C.Pin = GPIO_PIN_7; GPIO_InitStruct_C.Mode = GPIO_MODE_INPUT; GPIO_InitStruct_C.Pull = GPIO_NOPULL; GPIO_InitStruct_C.Speed = GPIO_SPEED_MEDIUM; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct_C); Using an oscilloscope, i noticed that on this pin i receive a signal, that printed by HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_7) is equal to 1 for default. This situation creates interferences to an Arduino Shield. How is it possible to put this value to 0, i.e. reset the PC7 ? Thank you for your help. #gpio #mode #reset #input- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-18 10:59 AM
You can use HAL_GPIO_WritePin for this.
I think it is:HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_RESET);- Robert- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-18 11:26 AM
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_RESET), it works without
Shield
Justinsert
the
shiled
read me
1
,however, if
I do
the same with
Arduino
I read
0.
Why
?I must say
that I use
the
UART2
to interact
with
Shiled as example firmware of.
* @file UART/UART_Printf/Src/main.c * @author MCD Application Team * @version V1.1.0 * @date 26-December-2014 * @brief This example shows how to retarget the C library printf function * to the UART.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-18 11:44 AM
If you want to control the pin, INPUT is probably not the mode to use.
If it's an input and you want it low by default, consider setting the Pull-Down on the pin, otherwise it's going to float.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-19 1:57 PM
Hi, thank you to all of you. Your suggestion about pull down clarified our ideas. Then, using oscilloscope we idetntified which pins set the pin PC7 to the high value.
Best Regards