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.

Can interrupt number assigned by Timer_create be configured?

Other Parts Discussed in Thread: SYSBIOS

Hello,

I posted the following question to the Multicore forum (http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/285187/995065.aspx#995065) and was advised that I would probably get a better response here. I was also told to look at this post for help: http://e2e.ti.com/support/embedded/bios/f/355/t/94262.aspx

I have looked at that post but it talks about changing the field timerParams.intNum.

This is after declaring this: var Timer = xdc.useModule('ti.sysbios.hal.Timer');        var timerParams = new Timer.Params();

I cannot do that because there is no "intNum" field available for timerParams as far as I can tell. This is from the file MCSDK\bios_6_33_04_39\packages\ti\sysbios\hal\Timer.h

struct ti_sysbios_hal_Timer_Params {
    size_t __size;
    const void* __self;
    void* __fxns;
    xdc_runtime_IInstance_Params* instance;
    ti_sysbios_interfaces_ITimer_RunMode runMode;
    ti_sysbios_interfaces_ITimer_StartMode startMode;
    xdc_UArg arg;
    xdc_UInt32 period;
    ti_sysbios_interfaces_ITimer_PeriodType periodType;
    xdc_runtime_Types_FreqHz extFreq;
    xdc_runtime_IInstance_Params __iprms;
};

There is no intNum field.

Also in the CCS Help system when I search for Timer_create, it shows me this for the module ti.sysbios.hal.Timer:

typedef struct Timer_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    UArg arg;
    // Argument for tick function
    Types_FreqHz extFreq;
    // Timer frequency
    UInt32 period;
    // Period of a tick
    ITimer_PeriodType periodType;
    // Period type
    ITimer_RunMode runMode;
    // Timer run mode
    ITimer_StartMode startMode;
    // Timer start mode
} Timer_Params;

There is no intNum field.

So I'm copying my original post below and I'd like to know how to control the interrupt number used by the timer. Thanks.

ORIGINAL POST:

I am working with a C6670. I want a 10mS timer to trigger periodic processing so I have set up a timer as follows:

   Error_Block eb;
   Timer_Params timerParams;
   Timer_Handle timerHandle = 0;
   SSP_RESULT ret = SSP_OK;

   Error_init(&eb);
   Timer_Params_init(&timerParams);
   timerParams.period = 10000; /* 10 ms */
   timerHandle = Timer_create(Timer_ANY, TimerTickFunction, &timerParams, &eb);
   if (timerHandle == NULL)
   {
      PRINT_ERROR("Timer create failed\n");
      ret = TARGET_INTERRUPT_MANAGER_TIMER_CREATE_FAIL;
      TARGET_HLL_SetErrorEvent(&ret);
      return ret;
   }

   return ret;

The call to Timer_create was failing. Debugging showed that another interrupt assigned to interrupt number 4 was causing this problem:

Hwi_create(4, TempAlarmIsrHandler, &hwiParams, &eb);

If the interrupt number in this call to Hwi_create was changed from 4 to 6 then the timer was successfully created. After the call to Timer_create, this new field appeared in the ROV Hwi view: IntNum = 4, fxn = TImerTickFunction, eventId = 65 (Data manual shows that event 65 is TINTHn6 Local Timer interrupt high).

My question is why Timer_create uses IntNum = 4.  Is this configurable? I haven't been able to find a description of the default interrupt number in the timer documentation which I have looked through.

Thanks,
Geraldine

  • Geraldine,

    Yes, the interrupt number for the timer is configurable.

    However you must use the device specific Timer module rather than the generic hal Timer module to achieve this.

    For your device, it appears to me that you need to use the ti.sysbios.timers.timer64.Timer module.

    This Timer module adds device specific functionality to the generic Timer module interface provided by the ti.sysbios.hal.Timer module.

    The Timer.Params of the timer64.Timer module does have an intNum field.

    Alan

  • Thanks Alan, I'll try that.

    Geraldine