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.

RTOS/AWR1642BOOST: Discrepancy Between Code and Documentation

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: AWR1642, SYSBIOS

Tool/software: TI-RTOS

I am trying to utilize the 200MHz clock from the microcontroller of the master subsystem to perform a timing function. I have flashed the debug image onto my AWR1642 device,c ompile and build the binaries in CCS, load the binaries in CCS, and run the application in CCS to visualize the output. I read into the documentation of TI SYSBIOS and found the following function definitions that I thought woudl help me achieve the 5ns timing resolution (since the period of a 200MHz clock is 5ns, I should be able to count time at intervals of 5ns):

Basically, I want to substitute the "CLI_write" with my own function and time how long the function takes (in nanoseconds) but I was confused about the output of this code. The first print statement returned "2" which led me to believe that the amount of time that elapsed between "delayAmount=Clock_getTicks();" and the print statement is 2*5ns=10ns because each tick of the 200MHz clock should correspond to 5ns. But, upon printing the tick period, I received the value "100000" which implies that the tick period is 0.1 seconds. How can I make sure that the tick period is the lowest possible value (5ns)?

  • Hi,

    I don't think you will be able to achieve this with Clock_getTicks() API because this function internally uses a timer to set resolution of the ticks.

    You may be able to achieve this on the DSP side using the TSCL register which counts the DSP cycles

    Please see this information for C6000 DSP

    processors.wiki.ti.com/.../Customizing_the_clock_and_time_Functions

    Thank you
    Cesar
  • For timing/profiling, there are already methods to do this:

    On the MSS, use "Pmu" calls to grab the 200Mhz clock:

    Pmu_configureCounter(counter, 0x11, FALSE);
    Pmu_resetCount(counter);
    Pmu_startCounter(counter);
    Pmu_stopCounter(counter);
    val = Pmu_getCount(counter);

    On the DSS, simply use the core register TSCL/TSCH (TSCH is the high word, usually not needed).  This register ticks at 600Mhz.  You can set it to zero if you wish, and read it into a variable before and after a chunk of code.  Or, just stop the debugger and look at TSCL using the "Registers" tab in the debugger.

  • Thank you both for your replies. These suggestions should give me enough to work with and test.