2014-02-19 05:10 AM
Hi all,
I have a question about HSE clock source. I loaded the demo and added some code to check the HSE clock on PA8....
GPIO_InitTypeDef GPIO_InitStructure;
...
int main(void){
...
RCC_HSEConfig(RCC_HSE_ON);
RCC_WaitForHSEStartUp();
/* GPIOA clock enable */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
RCC_MCOConfig(RCC_MCOSource_HSE , RCC_MCODiv_1);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource8, GPIO_AF_MCO);
/*GPIOA Configuration: Pin 8*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStructure);
...
Then I measured with Oscilloscope on PA8 and it shows 4MHz , but when I measure direct on the pin of the oscillator it shows 8MHz.
Where is the problem?
Best Regards,
David.
#stm32l100cdiscovery
2014-02-24 05:45 AM
Hi clive1,
Is there another way to do this because when I toggle twice the signal on Oscilloscope is not stable?I want to use the timer for Uart timeout error detection. Period double only happens when toggling?My question : Is the timer in correct configuration to generate 1ms interrupt?Regards,David.2014-02-24 06:06 AM
My question : Is the timer in correct configuration to generate 1ms interrupt?
Yes, and when toggling your high time is 1 ms, the low time is 1 ms, the period is thus 2 ms