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.

RTOS/CC1310: The interrupt priority of Timer

Part Number: CC1310

Tool/software: TI-RTOS

I want to set the interrupt priority of Timer2A to the highest priority.

I modify 

const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMERPARTSCOUNT] = {And
    { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
    { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
    { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
    { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
    { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (1 << 5), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
    { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
    { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
    { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
};

And IntPriorityGet(INT_GPT2Ai);

The result is 0xE0 yet, not desired 0x20

 Why

  • Hello User,

    Make sure you do the following in this order:

    GPTimerCC26XX_Params params;
    GPTimerCC26XX_Params_init(&params);
    hTimer = GPTimerCC26XX_open(CC2650_GPTIMER0A, &params);
    GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_TIMEOUT);

    and then check the int priority.

    Regards,

    AB

  • Hi AB
    1. I used the founctions of timer,as follows

    Power_setDependency(PowerCC26XX_PERIPH_GPT2);
    Power_setConstraint(PowerCC26XX_SB_DISALLOW);
    Hwi_Params params;
    Hwi_Params_init(&params);
    params.enableInt = TRUE;
    params.priority = 1;
    Hwi_construct(&timerHwi, INT_GPT2A, &interruptTimerA, &params, NULL);

    /* Configure the timer hardware */
    TimerDisable(GPT2_BASE, TIMER_A);
    TimerConfigure(GPT2_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC);//TIMER_CFG_B_ONE_SHOT
    TimerPrescaleSet(GPT2_BASE, TIMER_A, 9); //
    TimerLoadSet(GPT2_BASE, TIMER_A, 600); //

    TimerIntClear(GPT2_BASE, TIMER_TIMA_TIMEOUT);
    TimerIntEnable(GPT2_BASE, TIMER_TIMA_TIMEOUT);
    TimerEnable(GPT2_BASE, TIMER_A);

    Because I need often run timer (start and stop continually), so I think founctions of timer lib are quick and simple.

    2. If I use these founctions, can I only used IntPriorityGroupingSet() to set the priority.

    3.Are there any difference betweens timer lib and GPTimerCC26XX

    4.If I can only use GPTimerCC26XX ,Could you give me a link on TI Resource Explorer.

    Thanks
  • Hello,

    You can use these timer functions, but know that the TI RTOS will not be managing these resources and you will need to do it by yourself. The advantage of using GPTimer is that it is part of the TI drivers which is all handled by the TI RTOS. The Timer functions are one layer above Register level writing, and this is why is much faster.

    Regards,
    AB