2011-03-17 05:40 AM
Problem in setting the clock of my device .
2011-05-17 05:28 AM
For 72 MHz from an 8 MHz external
Set the PLL to HSE DIV 1, and MUL 9?2011-05-17 05:28 AM
if(SysTick_Config(SystemCoreClock /3150) ) // 1ms interrupts
{ while(1); // error}
when I used this , ;I get correct interrupts every 1ms !2011-05-17 05:28 AM
2011-05-17 05:28 AM
Could it be from the system tick settings ?
if(SysTick_Config(SystemCoreClock / 1000) ) // 1ms interrupts where it does not set it to 1ms , it set it to 3ms , can it be ? how can I check that . ? anyway ?2011-05-17 05:28 AM
if(SysTick_Config(SystemCoreClock /3150) ) // 1ms interrupts
{
while(1); // error
}
when I used this , ;I get correct interrupts every 1ms !
Dude, this is because your processor is running at 23.04 MHz, not 72 MHz.
25 / 8 = 3.125
3125 would be the ideal value for 1 ms.
2011-05-17 05:28 AM
From Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h, either modify the HSE_VALUE here, or make sure you use -DHSE_VALUE=8000000 on the compiler command line in the project.
/** * @brief In the following line adjust the value of External High Speed oscillator (HSE) used in your application Tip: To avoid modifying this file each time you need to use different HSE, you can define the HSE value in your toolchain compiler preprocessor. */ #if !defined HSE_VALUE #ifdef STM32F10X_CL #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ #else #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* STM32F10X_CL */ #endif /* HSE_VALUE */2011-05-17 05:28 AM
2011-05-17 05:28 AM
Already I have in uv4 under c/c++
USE_STDPERIPH_DRIVER, STM32F10X_CL,HSE_VALUE=8000000 did I forget to set something else ?2011-05-17 05:28 AM
Maybe you need to ''Clean'' and ''Rebuild All'' to make sure the library is built with the right frequency.
Or you could edit the file directly, as suggested before. If your 1ms tick is still 3.125 ms then somewhere in your code/libraries it thinks the source clock is 25 MHz and setting the PLL accordingly. Run the debugger through the PLL setup code, ie uncheck run-to main() and step through the init code.