Pin PF0 as GPIO input doesnt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 12:56 AM
I'm using a STM32F030R8 and configured the pin PF0 as a GPIO-Input. But when i read the pin it is randomly 1 or 0.
The code was generated with the CubeMX SW. When i try an other pin for exsample PB1 it works fine.
The same issue i have with the STM32F302R8 board
Does anyone know this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 1:24 AM
What's connected to that pin externally? What happens if you switch on a pullup or pulldown in GPIO_PUPDR?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 2:19 AM
For both devices, PF0 is the HSE oscillator input pin.
Make sure HSE is not enabled because it takes precedence over the GPIO configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 3:30 AM
I just put the pin on GND or 3.3V. Pullup or pulldown makes no differents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 3:36 AM
How do you check that input, in the debugger?
Post the relevant RCC and GPIO registers' content.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 4:12 AM
PF0 is OSC_IN. Do you have RCC_CSR.HSEON set? (See 8.3.13 Using the HSE or LSE oscillator pins as GPIOs in RM0360.)
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 4:29 AM
I found my mistake. On the Nucleo-Board is the PF0 default not with the pinheader connected.
But thanks for all your help
Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 5:27 AM
The RCC clock is disable and the PF0 is set to GPIO_Input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-23 11:23 PM
On the nucleo boards, in the default hardware configuration, PF0 is connected to the STLink MCU clock out (MCO).
The purpose is to be able to use HSE set in bypass mode.
This is done this way to save the cost of one crystal and free PF1 while still having a precise clock.
