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.

Timer Priorities in Z-Stack

Other Parts Discussed in Thread: Z-STACK

Hello Everyone,


Can anyone tell about the priorities of Timer? I want to know which timer have highest priority, I am using Timer1 Channel 0 with Interrupt here I have selected this interrupt to highest priority using P2DIR and P2SEL registers. Now here does this timer ISR have higher priority than the MAC timer? 

If not than how can I change the Timer1 Priority to the highest? 

  • Hi,
    please check section 2.5.3 in www.ti.com/.../swru191
    Interrupts priority can be selected using IP0 and IP1 registers.
    RF and Timer2 (MAC) priority are set in Z-Stack to level 1.
    I recommend doing the same for T1. Since T1 belongs to a group that has higher priority in the polling sequence, that would resolve automatically in Timer1 interrupts being serviced before Timer2 in case interrupts requests are received simultaneously.
    I don't recommend increasing the interrupt to a level higher than 1 otherwise you run the risk of pre-empting RF interrupt with timer interrupt.

    Thanks,
    TheDarkSide
  • Hello,


    Thanks for the reply.

    I have already set the Priority of Timer1 to the Highest. Can you tell me the way how would it be possible to set Timer1 Priority higher than MAC and RF?

  • Level 1 is not the the highest level. Level 3 is the highest one so you would need to configure the aforementioned registers accordingly.
    The priority group membership only decides the order when the level is the same and interrupts are simultaneous.

    From www.ti.com/.../swru191

    "Each group is assigned one of four priority levels. While an interrupt service request is in progress, it cannot be
    interrupted by a lower- or same-level interrupt"

    RF and Timer 2 are set to 1, so if you really want to assign Timer 1 the highest priority just configure the IPx registers to a value higher than 1.
    I would be careful though since RF operations are extremely time critical so you should be careful when pre-empting RF interrupts.

    TheDarkSide