This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 Timer Interrupt



Hello,

i have a heavy problem with the timer Interrupt...

I use timer 4 with Channel 0 and Channel 1 in modulo mode...

The Channel 1 has to run till T4CC1==0x0f and T4CC0== 0xff;

I understood the introduction that if Timer 4 Channel 1 == T4CC1 then it throw an interrupt and if the Timer 4 Channel 0 incrementing till 0xff and then it will throw an interrupt and after that both are reseting to 0 and the play it starts again....

But when i went to the T4_ISR at the first time, then is set TIMIF.T4CH1IF and TIMIF.T4CH0IF and i can´t reset both.... Can anybody help me?

Best regards

Brian

  • Hello Brian,

    Remember to also reset the CPU interrupt flag after you reset the timer module interrupt flag (T4CH1IF) in the timer4 ISR:

    // First clears the module interrupt flag which was triggered (not all three every time).
    T4CH1IF = 0; // Channel 1

    T4CH0IF= 0; // Channel 0

    T4OVFIF = 0; // Overflow

    // Then clears the CPU interrupt flag.
    T4IF = 0;