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.

Simulatneous GP timeout interrupts

Hello there

I am using two GP timers simultaneously to continuously generate timeout event interrupts. However, I know at some stage they will both assert a timeout interrupt at almost exactly the same time.

Now, according to my understanding, seeing as I have not set any priority levels, this will result in the ISR corresponding to the timeout event that just happened to occur before the other one, running first while the second ISR remains pending and then runs after the first one has been completed. I don't want this to happen, so is there a way I can just clear any possibly pending timeout interrupts so as to prevent the second ISR from running immediately after when the two timeout events happen so close to one another? 

Thanks a lot.

  • Hello Joshua

    You can unconditionally clear the interrupt, but then this is what interrupts are not designed for. They are a means by which the peripheral can notify the CPU, that there is an event that needs to be processed.

    Also if there is an unconditional clear, it is not a guarantee, that the interrupt from the 2nd source occurs after the unconditional clear....

    Regards
    Amit
  • I don't want this to happen, ...

    Why not ?

    Timer interrupts are not an end in itself - there is (usually) an action associated that should be triggered at regular intervals. Is your intention to cancel that second action if both interrupts happen to coincide ?

    I would rather think about prioritizing the interrupts according to the associated action. Or, synchronize both timers that the interrupts don't coincide.

  • Hello, thank you for taking the time to reply. I have actually determined that I don't need to do what I was asking the question about.

  • Hello Joshua

    And it would be very interesting to know how you arrived at that determination?

    Regards
    Amit