cancel
Showing results for 
Search instead for 
Did you mean: 

TIM2 Interrupt period issue

asterik37
Associate
Posted on February 22, 2015 at 21:49

The original post was too long to process during our migration. Please click on the attachment to read the original post.
3 REPLIES 3
Posted on February 22, 2015 at 23:58

Are you sure it's not clocking off the HSI source (16 MHz). Review code in SystemInit(), and system_stm32f4xx.c. That the PLL locks, and it's selected as a source.

Internal clocks can also be output via MCO1 (PA8).

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
asterik37
Associate
Posted on February 23, 2015 at 02:41

Thanks Clive.  The SystemInit() prototype was still commented out in ''startup_stm32f4xx.h'' and was never being called either.  I think this results in defaulting to the HSI for the system clock? 

I also corrected HSE_VALUE in ''stm32f4xx.h'' from the default 25MHz to 8Mhz so I can use the external crystal.  It's working now.

Thanks again.

Posted on February 23, 2015 at 03:41

The mechanics of the CMSIS implementation have SystemInit() called prior to the usual C startup code, and main()

With both Keil and IAR, you'd expect to see a assembler level call to SystemInit from the ResetHandler code. Other systems like CooCox which ignore the usual route have to call SystemInit from main()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..