2014-07-23 08:13 PM
HI,
I have faced one problem with PORTF pin configuration (PF0,PF1).My GPIO configuration:RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF, ENABLE); InitGpio.GPIO_Pin = (GPIO_Pin_0 | GPIO_Pin_1 ); InitGpio.GPIO_Mode = GPIO_Mode_AF; InitGpio.GPIO_Speed = GPIO_Speed_Level_1; InitGpio.GPIO_OType = GPIO_OType_PP; InitGpio.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOF, &InitGpio);I am not getting any output from those PINs, if i tried normal GPIO configuration also. .please suggest us is there any issue with that configuration.Regards,Chowdaiah2014-07-23 08:41 PM
Is this on a Discovery Board? Are there solder bridges related to getting these to header pins?
/* GPIOF Periph clock enable */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF, ENABLE);
/* Configure PF0 and PF1 in output pushpull mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOF, &GPIO_InitStructure);
2014-07-23 10:24 PM
it is not evaluation board , we have build for our small project purpose.
2014-07-24 12:20 AM
Reference manual says these pins are special, looks like there is no point in configuring PF0/1 as alternate function.
RM0360:8.3.13 Using the HSE or LSE oscillator pins as GPIOs
When the HSE or LSE oscillator is switched OFF (default state after reset), the related
oscillator pins can be used as normal GPIOs.
When the HSE or LSE oscillator is switched ON (by setting the HSEON or LSEON bit in the
RCC_CSR register) the oscillator takes control of its associated pins and the GPIO
configuration of these pins has no effect.
When the oscillator is configured in a user external clock mode, only the OSC_IN or
OSC32_IN pin is reserved for clock input and the OSC_OUT or OSC32_OUT pin can still be
used as normal GPIO.
2014-07-24 01:15 AM
2014-07-24 06:04 AM
I can set these pins to output without library:
#include <stm32f0xx.h>
RCC->AHBENR |= RCC_AHBENR_GPIOFEN;
GPIOF->OTYPER = 0;
GPIOF->OSPEEDR = 0;
// PF0/1 output
GPIOF->MODER = GPIO_MODER_MODER0_0 | GPIO_MODER_MODER1_0;
// PF0/1 no pull
GPIOF->PUPDR = 0;
GPIOF->BSRR = GPIO_BSRR_BS_0 | GPIO_BSRR_BS_1;
2014-07-25 01:53 AM
I have tried this one also but it is not working.
2014-07-25 06:10 AM
May be it's your board or chip, or how the chip is soldered. Do you have multiple boards exhibiting this problem? I don't have any TTSOP20 parts to evaluate.