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.

DM642 to DM647 Timer question

Hi all,

I've been migrating some old DM642 CSL based code to a DM647.  I use to use the TIMER_ which were available in the csl_timer header.  I've been poking around through the PSP modules and samples, and so far I can only find CSLR calls to access the DM647 timer.  Is there a high-level API for the timer?  If not what's the best wat to replace the functionality of the TIMER_getCount() call?

Thanks,

Peter

 

  • Peter,

    I'll look into the PSP and let you know what is available.

    Regards,

    Brad

  • Hi Peter

    For DM647/8 only CSLR support was provided and the high level CSL APIs are not available. The user may have to implement his own TIMER_getCount() function using CSLR.

    Regards,

    Vichu

  • Thanks Brad and Vichu.

    I believe I have the timer initialized (my code is based on the timer sample application), but I don't know which register to probe for the time.  Could you give me a push in the right direction?

    Thanks,

    Peter

     

  • Peter,

    Please refer to Section 2.3 of the 64-Bit Timer user guide (spruel0) for details on how the count values are stored in the registers.

    Regards,

    Brad

  • Hi Peter,

    one possibility to access the timer registers on DM647/648 is to use the cslr - Headers of pspdrivers:

    #include <ti/sdo/pspdrivers/soc/dm648/dsp/soc.h>
    #include <ti/sdo/pspdrivers/soc/dm648/dsp/cslr.h>
    #include <ti/sdo/pspdrivers/soc/dm648/dsp/cslr_tmr.h>

    CSL_TmrRegsOvly tmr0Regs = (CSL_TmrRegsOvly)CSL_TMR_0_REGS;
    cnt = tmr0Regs->TIM12;

    do you use DSP BIOS? if yes, the DSP BIOS api should be an option:

    #include <std.h>
    #include <hwi.h>
    #include <clk.h>

    cnt = CLK_gethtime();
    tick = CLK_getltime();

    maybe this thread is interesting for you:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/p/6332/23876.aspx#23876

    bye,

    Thomas

  • Thanks a lot for the help.  I'll try out the CLK calls first to see if they are a good replacement or not, and then drop down to the CSLR level only if necessary.

     

    Peter

     

  • Unfortunately I do not have a DM642 available to test the old code on.  Do you have any idea what the difference should be between calling the old CSL TIMER_getCount() and the BIOS CLK_gethtime()?  The CSL documentation is a little vague, but it does sound like they're suppose to do the same thing.  Is that correct?

    Thanks,

    Peter

  • Hi Peter,

    as far as I know CSL is no longer available on DM648. Using the BIOS api works on both processors (DM642/648). The alternative to BIOS on DM648 is CSLR (not API functions but access to registers) which works like

    CSL_TmrRegsOvly tmr0Regs = (CSL_TmrRegsOvly)CSL_TMR_0_REGS;
    cnt = tmr0Regs->TIM12;