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.

64bit timer on c6657



HI, all.

 

I am using as follows.

                 SYS/BIOS: 6.34.4.22

        NDK: 2.21.1.38

                  MCSDK: 2.1.2.6

                  PDK: c6657 1.1.2.6

 

C6657 shoud have eight 64bit timers.

But Timer_getStatus() function returns "INUSE" when timer_id is specified form 4 to 7.

This function returns "FREE" when timer_id is specified form 0 to 3.

On registers view in Code composer studio, from timer 4 to timer 7 do not seem to be used.

Do I need to set anyting? 

Please give me advise.

 

Best Regards,

Katsuhiko Watanabe

 

  • Katsuhiko,

    What program are you running? Can you provide the details or upload your test project?

    Regards, Eric

  • Hi Watanabe,

    It turns out that the Timer64 module does not use shared timers unless you explicitly specify it in the .cfg file. Please, see the timer64 API documentation on how to use the shared timers. The reason you're seeing 4 timers is because the 1st 2 local timers are used in 32-bit unchained mode.

  • Eric, Tom

    Thank you for your reply.

    The return value of Timer_getStatus( timer_id) is "FREE" when timer id is set from 0 to 3.

    But "INUSE" when timer id is set from 4 to 7.

    I set *.cfg file as follows.

    http://e2e.ti.com/support/embedded/bios/f/355/t/212282.aspx


    But the result is same.

    Please give me advise.

    Regards,

    Katsuhiko Watanabe

  • The posted linked also applies to your device, with the exception that on the C6657, Timers 0-3 are local timers and Timers 4-7 are shared.

    Timer_getStatus() API will not return with "FREE" on shared timers as they are masked out internally within the timer64 module. To use the shared timer, please refer to Ashish's post which at that point implies that its INUSE.

    With the shared timer created in the .cfg, a _getStatus should return "INUSE". If you're running out of timers, I'd suggest to use a shared timer for the Clock module so you'll have another local timer to use.

    From the timer64 API docs:

    Note: Creating a timer with 'Timer.ANY' specified as the id will not return a shared timer on a homogeneous multicore device. To use a shared timer, specify the timer id explicitly when creating it. On these devices Timer.ANY specifies the local timer id. This allows a single image to run on multiple cores since each core will program a different local timer.
    The following sample .cfg code sets core 1 to initialize a shared timer with id 4.
     var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer'); // sets core 1 to init and release Timer 4. Timer.timerSettings[4].ownerCoreId = 1; 
    The following sample .cfg code sets core 0 to initialize a shared timer with id 4. It also configures the Clock module to use this timer. This allows multiple cores to share timer 4 for the Clock module's interrupt source.
     // sets core 0 to init and release Timer 4. var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer'); Timer.timerSettings[4].ownerCoreId = 0; var Clock = xdc.useModule('ti.sysbios.knl.Clock'); Clock.timerId = 4;
    
  • Tom

    Thank you for your reply, and sorry for  my delayed response to your answer.

    I tried the way you taught me, but the result is same.

    I need 1us timer, but I can't use clock timer for it.

    Because when clock timer is used for 1us timer, other process is not executed due to interrupt clock process of 1us.

    Regards,

    Katsuhiko Watanabe