AnsweredAssumed Answered

HSE clock on STM32L100CDISCOVERY

Question asked by vrtaric.david on Feb 19, 2014
Latest reply on Feb 24, 2014 by Clive One
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.

Outcomes