AnsweredAssumed Answered

Timer 3, Interrupt frequency>1MHz

Question asked by majchrzak.lukasz on Jan 11, 2012
Latest reply on Jan 12, 2012 by Clive One
How to get interrupt frequency bigger than 1MHz ?
I have Discovery F4 Board and use Timer 3 as TIM_TimeBase Example.

I have code as follow:

__IO uint16_t CCR1_Val = 10000;
__IO uint16_t CCR2_Val = 1000;
__IO uint16_t CCR3_Val = 100;
__IO uint16_t CCR4_Val = 10;

PrescalerValue = (uint16_t) ((SystemCoreClock / 2) / 84000000) - 1;

  TIM_TimeBaseStructure.TIM_Period = 65535;
  TIM_TimeBaseStructure.TIM_Prescaler = 0;
  TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure);

  TIM_PrescalerConfig(TIM3, PrescalerValue, TIM_PSCReloadMode_Immediate)

Chanels and stm32f4xx_it.c are configured as TIM_TimeBase Example.

(Measured toggling frequency)=(Interrupt frequency)/2



                                                                                                                                                                                                                                                                                                                                                                                           
  TIM3CC=84MHz 
 CCRx_VAL
           
 Measured toggilng f. [Hz]
           
Theoretic Interrupt f.  [Hz]
           
 1 10000 4200 8400
 2 1000 42000 84000
 3 100 640.6 bad
           
 840000
 4 10 406.8 bad
           
 8400000

Why there are bad values?

Next example:


                                                                                                                                                                                                                                                                                                                                                                   
           
 TIM3CC=1MHz
           
 CCRx_VAL  Measured toggilng f.  [Hz]
           
 Theoretic Interrupt f.  [Hz]
           
 1 65530 7,62 15,260
 2 64000 7,81 15,625
 3 10 50000 100000
 4 5 15,25 bad
           
 200000

I need  10MHz interrupt frequency in my project, how can I get this?

Outcomes