This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A question about timer configuration

Hi all,
I am relatively new to the ARM family and I didn't find an answer in the documentation, unfortunately...
I am trying to change the interrupt rate of my STR7's timer 0. I have an 16[Mhz] external oscillator. Could you explain to me why the following setting generates an interrupt every 130[ms]?

// Initialize the Timer
TIM_Init (TIM0);
// Configure Timer 0 Prescaler
TIM_PrescalerConfig (TIM0,0x0F);
// Enable Timer 0 Overflow Interrupt
TIM_ITConfig(TIM0,TIM_TO_IT,ENABLE);

Parents
  • Andy,
    Sorry for that...
    I am using the standard ST library, without any fishy modifications.

    #define ENABLE          1
    #define TIM0_BASE       (APB2_BASE + 0x9000)
    #define TIM0            ((TIM_TypeDef *)TIM0_BASE)
    
    and
    
    typedef volatile struct
    {
      vu16 ICAR;
      vu16 EMPTY1;
      vu16 ICBR;
      vu16 EMPTY2;
      vu16 OCAR;
      vu16 EMPTY3;
      vu16 OCBR;
      vu16 EMPTY4;
      vu16 CNTR;
      vu16 EMPTY5;
      vu16 CR1;
      vu16 EMPTY6;
      vu16 CR2;
      vu16 EMPTY7;
      vu16 SR;
    } TIM_TypeDef;
    

Reply
  • Andy,
    Sorry for that...
    I am using the standard ST library, without any fishy modifications.

    #define ENABLE          1
    #define TIM0_BASE       (APB2_BASE + 0x9000)
    #define TIM0            ((TIM_TypeDef *)TIM0_BASE)
    
    and
    
    typedef volatile struct
    {
      vu16 ICAR;
      vu16 EMPTY1;
      vu16 ICBR;
      vu16 EMPTY2;
      vu16 OCAR;
      vu16 EMPTY3;
      vu16 OCBR;
      vu16 EMPTY4;
      vu16 CNTR;
      vu16 EMPTY5;
      vu16 CR1;
      vu16 EMPTY6;
      vu16 CR2;
      vu16 EMPTY7;
      vu16 SR;
    } TIM_TypeDef;
    

Children