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.

about create a new timer problems by using CSL on 6616 chip

I have several questions about create a new timer problems by using CSL on 6616 chip :

1. In my opinion there are two methods to create a new timer one is using CSL the other is using Timer_create with cfg configuration file

my question about this is what is the difference between these two methods? Is it ok to use CSL method?

2. Now I am using CSL to create a new timer and I met two problems

(1)  when I execute the code I can not see the  timer I want to create with ROV view and I also can not enter timer ISR .

the following is the create timer process: In this test I want timer 5 to link to event 68 and hwi 12.

void SYS_Init_Timer(void)
{

// initialize timer register value

  /* set the timer mode to unchained dual mode */
    hwSetup.tmrTimerMode = CSL_TMR_TIMMODE_DUAL_UNCHAINED;
    hwSetup.tmrTimerPeriodLo = 0xffffffff;       // this should be a countdown in case we select EXT SRC
    hwSetup.tmrClksrcLo =CSL_TMR_CLKSRC_TMRINP;  // source external

    memset(&sys_timer_data[2].ObjTmr, 0, sizeof(CSL_TmrObj));

    sys_timer_data[2].hTmr =  CSL_tmrOpen(&sys_timer_data[2].ObjTmr, CSL_TMR_5 , NULL, &status);

    status   = CSL_tmrGetHwSetup(sys_timer_data[2].hTmr, &hwSetup);


    /* Stop the GP Timer */
    CSL_TmrResetLo(sys_timer_data[2].hTmr);

    /* set the timer mode to unchained dual mode */
    hwSetup.tmrTimerMode = CSL_TMR_TIMMODE_DUAL_UNCHAINED;
    hwSetup.tmrTimerPeriodLo = (125*850/6)/*SYS_TIMER5_TRACE_SEND_PERIOD*/;
    CSL_tmrHwSetup(sys_timer_data[2].hTmr, &hwSetup);

    // add timer5 ISR and link timer 5 event to hwi 12

    sysE_hwi_intSetup.intVectId     = CSL_INTC_VECTID_12;
    sysE_hwi_intSetup.sysEvtCount   = 1;
    sysE_hwi_intSetup.sysEvtId[0]   = CSL_GEM_TINT5L;
    sysE_hwi_intSetup.pCallbackFxn  = (void(*)(void*)) &SYS_Timer5_Isr;
    sysE_hwi_intSetup.pCallbackArg  = 0;
    sysE_hwi_intSetup.bEnable       = 1;

    ( void ) Interrupt_add_with_mask ( &sysE_hwi_intSetup, 0xFFF0  & ~((1<<6)|(1<<7)) );

    // Start the timer 5 

    CSL_TmrStartLo(sys_timer_data[2].hTmr,  CSL_TMR_ENAMODE_CONT);

}

(2) when I using EVM board 6614 to do the test timer 5 has linked to event 9 and hwi 13 which supposed should be event 68 and hwi 12.

(It is right when I used TI simulator to do the test . Timer 5 linked to event 68 and hwi 13 )

  • Hi Weiqiang,

    First, we are afraid but TCI6616 and TCI6614 are not supported in the forum.  Please allow me to mention the below from a general standpoint of C6000 DSP family.

    Yes, we have CSL and also Timer_something() of SYS/BIOS DSP OS to use hardware timers.

    If you plan to use SYS/BIOS, my recommendation is to use Clock module (and Timer module if you need) of SYS/BIOS as much as possible.

    The first reason is, operating timers by CSL is not recognized by BIOS so there may be chance that BIOS and CSL conflict on hardware timer resources.  (BIOS exclusively uses a timer module for real-time scheduling purpose.)

    The second reason is, generally speaking, SYS/BIOS module is easy to use and easy to port the code to different hardwares (6616 to 6614 etc.)

    To my best knowledge, operating timer by CSL is not observable by ROV.

    You see a BIOS Clock module example as a template in CCS project creating dialog as following.

    Best Regards,
    Atsushi