Skip to main content
Visitor II
May 24, 2006
Question

STR71X How to generate 40ms interupt

  • May 24, 2006
  • 2 replies
  • 705 views
Posted on May 24, 2006 at 11:03

STR71X How to generate 40ms interupt

    This topic has been closed for replies.

    2 replies

    drakulajAuthor
    Visitor II
    May 23, 2006
    Posted on May 23, 2006 at 05:49

    Hello,

    im beginer in ARM. Please how can I do interupt every 40ms? I tried to configurate timer like this:

    TIM_Init ( TIM1 );

    // Enable the IRQ0 for timer 1

    EIC_IRQChannelConfig( T1TIMI_IRQChannel, ENABLE );

    EIC_IRQChannelPriorityConfig( T1TIMI_IRQChannel, 1);

    EIC_IRQConfig( ENABLE );

    TIM_PrescalerConfig ( TIM1, 0x00 ); // speed is 1MHz divison 1

    TIM_ITConfig ( TIM1, TIM_OCA_IT, ENABLE );

    TIM_OCMPModeConfig ( TIM1, TIM_CHANNEL_A, 0x9C40, TIM_TIMING, TIM_HIGH );

    and how can i start the timer? I tried TIM_CounterConfig ( TIM1, TIM_START ); but its not working?! Please help :-[

    Jirka

    [ This message was edited by: drakulaj on 23-05-2006 09:21 ]

    Visitor II
    May 23, 2006
    Posted on May 23, 2006 at 14:58

    I would use the RTC. Look at the example provided in the STR7 library