2013-01-18 09:12 AM
First off, please bear with me as I am new to this new environment.....The board I am using is the STM32VL. Looking at the user manual, I found the description of the pins that I want to use for simple output push/pull. The user manual says that the ''main function'' is the same as the pin name (ie. PB10 --> Port B10). Now I have successfully been able to use other pins to do this simple output. The problem seems to be with a few certain pins. I have the pin, mode and speed already configured as well as the port clock speed that the pins are on. What am I doing wrong with these certain pins? I do not want to use their alternate functions, just their primary function for a simple high/low output...Any help would be appreciated.
2013-01-18 10:42 AM
So is PB10 a specific pin you have a problem with? What others?
I don't see PB10 conflicting with other board functions, care to post some code demonstrating your issue?2013-01-18 11:41 AM
2013-01-18 01:21 PM
Well a quick review of the schematic/manual and you'll observe that PC14 and PC15 are used by the 32.768 KHz X3 oscillator, you'll need to remove R15 and make the solder bridges SB14 and SB15 to use the external pins.
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/CD00267113.pdf
The pins that I'm currently experiencing difficulty is PC14 and PC15. This is the code Im using to configure the pins:
//Internal Clock
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC | RCC_APB2Periph_ADC1, ENABLE) ;
void config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_15 ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
// set pin high
GPIOC->BSRR = GPIO_Pin_14;
GPIOC->BSRR = GPIO_Pin_15;
2013-01-18 04:09 PM
I did see that, under the ''alternative function'' column. However the ''main function'' did not suggest anything out of the normal and since I wasn't using it in alternate mode I was concerned.... So what exactly is the purpose of the main function for that specific pin then?
2013-01-18 04:50 PM
I did see that, under the ''alternative function'' column. However the ''main function'' did not suggest anything out of the normal and since I wasn't using it in alternate mode I was concerned.... So what exactly is the purpose of the main function for that specific pin then?
Well there's that suffix (1) saying the default is for the oscillators. You'll need to review that manual, and the ones for the F100 part, and F1 series in concert to understand what the reset behaviour is. Most default to GPIO inputs, where as others are committed to JTAG, and low-power oscillators. There are also a number of pins power from the low power (VBAT) domain, and these (PC13,14,15) have very low current, and frequency, drive capabilities.2013-01-18 05:25 PM
I should have looked more closely, especially at the electrical schematic of the mcu. Once again, thanks for your help clive1.