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.

Global timer problem

Hi,

I wrote a routine based on one of the functions found in the PDK's called timer_test.c.

I'm not using interrupt. The idea is to use csl in order to configure the timer in core 0 and read the global timer from core 0 and core 1.

I configured the global timer from core 0 (similar to the example in timer_test.c).

In order to get a handler, in core 1, I called , only the CSL_tmrOpen function for the same global timer.

The reading from core 0 is ok, but from core1 I always receive 0.

- Could somebody tell me what should be the problem I didn't succeeded for reading the global timer from core 1 and what to do?

Thanks in advance.

Shmuel

  • Shmuel,

    Which DSP device are you using?

    In the two cores, what do you do differently before and after their calls to CSL_tmrOpen()?

    What is different in the contents of the two TmrObj structs?

    Regards,
    RandyP

  • Sorry,

    I'm using C6678.

     

    in the core0 I wrote:

    /* Open the timer. */ 
        hTmr =  CSL_tmrOpen(&TmrObj, IntcInstance, NULL, &status);
        if (hTmr == NULL)
            return -1;

        /* Open the timer with the defaults. */
        CSL_tmrHwSetup(hTmr, &hwSetup);

        /* Stop the Timer */
        CSL_tmrHwControl(hTmr, CSL_TMR_CMD_RESET_TIMHI, NULL);
        
        /* Set the timer mode to unchained dual mode */
        hwSetup.tmrTimerMode = CSL_TMR_TIMMODE_DUAL_UNCHAINED;
        CSL_tmrHwSetup(hTmr, &hwSetup);
           
        /* Load the period register */
        status = CSL_tmrHwControl(hTmr, CSL_TMR_CMD_LOAD_PRDHI, (void *)&LoadValue);

        /* Start the timer in CONTINUOUS Mode. */
        CSL_tmrHwControl(hTmr, CSL_TMR_CMD_START_TIMHI, (void *)&TimeCountMode);

        while(TRUE)
        {
             for(j =0; j<100; j++);
             CSL_tmrGetTimHiCount(hTmr, &count);
        }
      

    In the core 1 I wrote:

    /* Open the timer. */ 
        hTmr =  CSL_tmrOpen(&TmrObj, IntcInstance, NULL, &status);
        if (hTmr == NULL)
            return -1;

         while(TRUE)
        {
             for(j =0; j<100; j++);
             CSL_tmrGetTimHiCount(hTmr, &count);
        }
      

     

    Thanks.

    Shmuel

     

  • Shmuel,

    My third question above was "What is different in the contents of the two TmrObj structs?"

    Which version of CCS are you using? Do you know how to use CCS to get this information?

    "IntcInstance" is an unusual variable name to use as a timer number. What is the value of that variable and what is its type?

    Regards,
    RandyP