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.

How to configure DM8168 DSP clock speed?

Other Parts Discussed in Thread: SYSBIOS

Hi,

I am using components from ti-ezsdk_dm816x-evm_5_03_01_15 to build message passing communication path between ARM and DSP cores. The problem I am having is that I configured the DSP to run at 1000MHz in the platform file (where the DSP CPU clock, memory and cache are configured), but when I use CLK_gethtime() to measure clock speed, it shows that the CPU is actually running at about 813MHz!!

The interesting thing is that CLK_getltime() and Task_sleep() works fine no matter what CPU clock speed i configure in the platform configuration file. It is because of this that I figured out that my DSP CPU is actually running at around 813MHz by looking at the CLK_gethtime() results.

Please see my code section and measurement results below. The LogTime(t1), LogLowTime(t1_low) just calls either CLK_gethtime() or CLK_getltime() and CLK_countspms() to figure out the time elapsed and to display it to the console ( as you see in the Measurement Results section below ).

Can some experts please help interpret the measurement results and tell me how to configure the DSP clock to a specified value?

Thank you!

Zhao

 

*******Begin Code Section********

void SendStatus(DspMsg_s* rxMsg, short msgId)

{

      unsigned int t1, t1_low;


    System_sprintf( rxMsg->d.status.status.versStr, "%s.%02d", "V_00", msgId );

     // Test code to find out the CPU clock speed

    t1 = CLK_gethtime();

    Task_sleep(100);// 100 ms

    LogTime(t1);

  t1_low = CLK_getltime();

    Task_sleep(10000);// 10 s

    LogLowTime(t1_low);

}

*******End Code Section********

 

*********Begin Measurement Results***********

[C674X_0] Sending a message #1 to 3

[C674X_0] elapsed time: ms[81] us[715]

[C674X_0] elapsed time: ms[10000] us[0]

[C674X_0] Sending a message #2 to 3

[C674X_0] elapsed time: ms[81] us[340]

[C674X_0] elapsed time: ms[10000] us[0]

[C674X_0] Sending a message #3 to 3

[C674X_0] elapsed time: ms[81] us[315]

[C674X_0] elapsed time: ms[10000] us[0]

*********End Measurement Results***********

 

*********Begin ARM Side Debug TimeStamps**********

Jun 26 23:48:18 WCS MeasRcv: Sending message #1 to DSP

Jun 26 23:48:28 WCS MeasRcv: Received DSP msg #1, response #1, Version is V_00.01

Jun 26 23:48:28 WCS MeasRcv: Sending message #2 to DSP

Jun 26 23:48:38 WCS MeasRcv: Received DSP msg #2, response #2, Version is V_00.02

Jun 26 23:48:38 WCS MeasRcv: Sending message #3 to DSP

Jun 26 23:48:49 WCS MeasRcv: Received DSP msg #3, response #3, Version is V_00.03

Jun 26 23:48:49 WCS MeasRcv: Successfully completed DSP message test, 3 loops

*********End ARM Side Debug TimeStamps**********

  • Assuming you are running Linux on the main ARM core.  U-boot/Linux combinations configure the dmtimers to be driven by a 32 KHz clock while others use a 20/24/27 Mhz clock.  For your specific device (TI816X) the default is 32 KHz clock.  All you can tell the DSP core is what the timer frequency is so as to match with the default timer frequency on Linux.  This is typically done as following in the DSP configuration.

    var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

    Timer.intFreq.hi = 0;

    Timer.intFreq.lo = 32768;

    These setting on the DSP will not touch timer at all thus your not seeing any change when doing so.  To change/affect the timer, it must be done in U-boot/Linux.  I'd suggest you post a question on the Linux forum to see how to accomplish this.

  • Arnie,

    Thanks for the reply. Do you mean that the U-boot/Linux has configured what speed DSP will run on TI816x? You are right we are using Linux and I do have the 3 lines of Timer statements in my configuration file. My timer is OK and correct.

    Are there anything i can do from the DSP side to change/reconfigure the DSP speed? I looked at MAINPLL_CTRL and MAINPLL_FREQ1 registers and could not change them because I did not specify R/W in my memory map for this space. I can poke around but that is not safe. I really just want to speed up my DSP frequency to the max of its rating.

    If you confirm that there is nothing i can do on the DSP side, I will go to Linux forum.

    Best Regards,

    Zhao

  • You may be able to write to the Timer registers directly from the DSP-side but I'm not sure the results.  I'm not aware of any DSP configuration lines that will changes these register values for you.

    I did find a couple related post which might be of some help.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/169375.aspx

    https://e2e.ti.com/support/dsp/davinci_digital_media_processors/int-dm81x/f/518/t/252117.aspx