2013-06-17 02:01 AM
I have used following code to get CLKout on PC9 but it didn't work:
Sysyteminit() was called earlier. /*Enable or disable the AHB1 peripheral clock */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); /*Configure GPIO pin alternate function */ GPIO_PinAFConfig(GPIOC, GPIO_PinSource9, GPIO_AF_MCO);2013-06-17 02:43 AM
Hello A2,
You have to configure the pin in AF mode then select the clock to be outpout:/* Enable the GPIOC peripheral */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
/*Configure MCO2 pin(PC9) in alternate function mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOC, GPIO_InitStructure);
GPIO_PinAFConfig(GPIOC, GPIO_PinSource9, GPIO_AF_MCO);
/* Select to output the SYSCLK */
RCC_MCO2Config(RCC_MCO2Source_SYSCLK, RCC_MCO2Div_1);
ST.MCU
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2013-06-17 03:11 AM
Thanks , it solved the problem. Also when I limit the GPIO freq by 100Mhz. but I set 120Mhz on MC02 & I was able to see it actually. How can this happen, Shouldn't it be limited to 100mhz
2013-06-17 03:32 AM
100MHz is the IO speed not the max system clock.
Even with less speed value, you should be able to output the SYSCLK, PLLCLK or HSE using the prescalers. Edit: You are right, for garanteed cases, the selected clock to output onto MCO must not exceed the maximum I/O speed. You can use the prescaler from 1 to 5 to get values greater than this speed (RCC_MCO2Div_x
).To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2013-06-17 04:41 AM
How can this happen, Shouldn't it be limited to 100mhz
It's a slew rate control setting, determining how hard/aggressively the pin is driven, it's external performance will be impacted by the capacitive load being driven. It is not a filter or physical limit in the sense you interpreted.