Skip to main content
Visitor II
August 21, 2009
Question

Timer0 and interrupt every fixed period. How??

  • August 21, 2009
  • 5 replies
  • 1127 views
Posted on August 21, 2009 at 07:31

Timer0 and interrupt every fixed period. How??

    This topic has been closed for replies.

    5 replies

    amorenoAuthor
    Visitor II
    November 5, 2007
    Posted on November 05, 2007 at 13:43

    Hello,

    I would be pleased if you could help me with my first TIMER and Interrupt routine.

    I'm trying to activate an interrupt every certain time.

    My is configure code of Timer & interrupt is:

    TIM_Init(TIM0);

    TIM_PrescalerConfig(TIM0, 6 );

    TIM_ClockSourceConfig(TIM0, TIM_INTERNAL);

    TIM_ITConfig(TIM0, TIM_TO_IT, ENABLE); /*Interrupt overflow*/

    TIM_CounterConfig(TIM0, TIM_START);

    EIC_IRQChannelConfig(T0TIMI_IRQChannel, ENABLE);

    EIC_IRQChannelPriorityConfig(T0TIMI_IRQChannel, 1);

    EIC_IRQConfig(ENABLE);

    unfortunetly if does work. The program dont go to interrupt routine. Why?

    Should I add something else?

    Thank you and best regards.

    Alfa.

    [ This message was edited by: amoreno on 05-11-2007 18:14 ]

    amorenoAuthor
    Visitor II
    November 6, 2007
    Posted on November 06, 2007 at 13:19

    Hello again, It is still not working :-[

    I see on registers that timer is running but the interrupt never is served.

    By the way, my board is STR711-SK/IAR and software Workbench Quicstard 4.42A (4.42.1.501)

    I'd aprreciate your help. I'm newbie in ARMs

    Thanks

    Alfa

    Visitor II
    November 16, 2007
    Posted on November 16, 2007 at 10:30

    May I suggest you to start from a working example?

    Consider that the only way to see an interrupt working is to put a breakpoint in the interrupt service routine and let go the program.

    I post here an example of a IAR Embedded workbech for an STR75x micro.

    I should be in the STR7xx directory a similar example, I suggest you to start from that.

    However the project could be compiled also for STR711, I think.

    Good luck.

    Marco

    ________________

    Attachments :

    Toggle_Mode.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtIx&d=%2Fa%2F0X0000000aLL%2FekdVNpMRzeGN.bO7xTWGo6hsZR9hyWlhKbwldE7mzsI&asPdf=false
    Visitor II
    August 21, 2009
    Posted on August 21, 2009 at 07:30

    I think that you can add this line;

    APB_ClockConfig (APB2, ENABLE, TIM0_Periph);

    and can added

    EIC_Init();

    dipol_84

    Visitor II
    August 21, 2009
    Posted on August 21, 2009 at 07:31

    APB_ClockConfig (APB2, ENABLE, TIM0_Periph);