STM32F030F4P6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-19 7:22 AM
Posted on March 19, 2017 at 15:22
Hallo.
Ich habe mal eine ganz bescheidene Frage.
Wie konfiguriere ich bei einem STM32F030x die beiden Pins (PF0/1) als Ausg�nge?
Im Datenblatt steht, dass diese angeblich nach Reset als solche benutzbar sind. Leider klappt das nicht.Alle anderen Pins funktionieren einwandfrei. Was habe ich vergessen?
GPIO_InitTypeDef GPIOx;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA,ENABLE);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB,ENABLE); RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF,ENABLE);GPIOx.GPIO_Mode = GPIO_Mode_OUT;
GPIOx.GPIO_OType = GPIO_OType_PP; GPIOx.GPIO_Pin = (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | |GPIO_Pin_6 | GPIO_Pin_7); GPIOx.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIOx.GPIO_Speed = GPIO_Speed_2MHz; GPIO_Init(GPIOA, &GPIOx);GPIOx.GPIO_Mode = GPIO_Mode_IN;
GPIOx.GPIO_Pin = (GPIO_Pin_13 | GPIO_Pin_14); GPIOx.GPIO_PuPd = GPIO_PuPd_UP; GPIOx.GPIO_Speed = GPIO_Speed_2MHz; GPIO_Init(GPIOA, &GPIOx);GPIOx.GPIO_Mode = GPIO_Mode_OUT;
GPIOx.GPIO_OType = GPIO_OType_PP; GPIOx.GPIO_Pin = GPIO_Pin_1; GPIOx.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIOx.GPIO_Speed = GPIO_Speed_2MHz; GPIO_Init(GPIOB, &GPIOx);GPIOx.GPIO_Mode = GPIO_Mode_OUT;
GPIOx.GPIO_OType = GPIO_OType_PP; GPIOx.GPIO_Pin = (GPIO_Pin_0 | GPIO_Pin_1); GPIOx.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIOx.GPIO_Speed = GPIO_Speed_2MHz; GPIO_Init(GPIOF, &GPIOx);GPIO_WriteBit(GPIOF, GPIO_Pin_0, Bit_SET)
Was mache ich falsch?
#stm32-stm32f4 #oscillator
Labels:
- Labels:
-
RCC
-
STM32F4 Series
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-19 8:59 PM
Posted on March 20, 2017 at 04:59
Make sure the HSE is disabled, I seem to recall the oscillator takes precedence.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
