2017-02-16 02:39 AM
Hi,
I need Help regarding time base.
I found one of the example and tried to modify that for STM32 F4 Discovery board.
I want to count number of external pulses by using TIM4 in 1.13 ms. So the time base is configured to generate interrupt after each 1.13 ms (as the read_me file states). the code is generating interrupt but it is not after 1.13 ms. can any body help me in this matter. I have attached the files for your review.
Thanks in Advance
#clive #clive1 #stm32-stm32f4Solved! Go to Solution.
2017-02-19 09:20 PM
the HE_Value (as defined in stm32f4xx.h)
#if !defined (HSE_VALUE)
// #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */#endif /* HSE_VALUE */I have checked the value is 7A1200 (8000000)
The PLL setting
/************************* PLL Parameters *************************************/
/* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */#define PLL_M 25#define PLL_N 336
/* SYSCLK = PLL_VCO / PLL_P */
#define PLL_P 2/* USB OTG FS, SDIO and RNG Clock = PLL_VCO / PLLQ */
#define PLL_Q 72017-02-19 09:29 PM
Can anyone tell me
how can I know the frequency (or time period) attached with counter of TIM3 in STM32f4Discovery? If there is any command .
How can I get how many interrupts are generated (interrupt counter)?
can anyone refer me to some example please?
2017-02-19 11:55 PM
I tried to use
if (SysTick_Config(RCC_Clocks.SYSCLK_Frequency / 1000))
by using RCC_Clocks.SYSCLK_Frequency the rate is 1ms
while for
if (SysTick_Config(SystemCoreClock / 1000))
the rate is 3.1 ms.
can anyone tell me what could be wrong... can't I get 1ms rate by using systemcoreclock??
2017-02-20 06:25 AM
,
,
25 / 8 = 3.125?
♯ define PLL_M 25 // You are not clocking at 25 MHz, shouldn't this be 8 ?
2017-02-20 06:06 PM
you are right,
Thank you very much for the help and support.
this was the problem.