cancel
Showing results for 
Search instead for 
Did you mean: 

HSE clock on STM32L100CDISCOVERY

david239955_stm1_st
Associate II
Posted on February 19, 2014 at 14:10

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
11 REPLIES 11
david239955_stm1_st
Associate II
Posted on February 24, 2014 at 14:45

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.

Posted on February 24, 2014 at 15:06

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
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..