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.

CCSv4 BIOS6 C6472 How does the timer tick period get set in terms of clock cycles

Other Parts Discussed in Thread: SYSBIOS

Hi

I the BIOS6 users guide it states

The period for the system tick is set by the configuration parameter
Clock.tickPeriod. This is set in microseconds.

How does the BIOS know what CPU clock is has in order to calculate the number of cycles per microsecond (and then what value it needs for the PRD register)?

I have a C6472 evm and its gel file sets the clock to 625 MHz. When I setup a clock timer using

    Clock_Params     clkParams;

    /* Create a periodic Clock Instance with period = 1ms * clkParams.period */
    Clock_Params_init(&clkParams);
    clkParams.period = 100;
    clkParams.startFlag = TRUE;
    clkParams.arg = (UArg)0x5555;
    Clock_create(InputMgrTimerInterruptHandler,
                 INITIAL_CLOCK_TIMEOUT, &clkParams, NULL);

I get a period of 112 msec instead of 100 msec - this is expected since my clock in 625 MHz and not 700 Mhz. (measured this using the time stamp on Log_print messages and a scope probe on the LEDs.)

So obviously BIOS thinks the clock is 700 MHz. I tried specifying the clock in the cfg as

BIOS.cpuFreq.lo = 625000000;  (clicked on the ti.sysbios.BIOS outline and expanded the cpuFreq value to display hi/lo values)

But that didn't change anything.

How do you specify the CPU clock so that the clock tick period is correct for the clkParams.period parameter?

Cheers

 

  • Hi Eddie,

    The C6472 device uses an external timer for the Clock tick source.  Therefore, you might also need to tell BIOS of the external timer frequencies by configuring the ti.sysbios.timers.timer64.Timer module.   If the timers and the CPU are all clocked by the same source, that could explain why you are observing a ratio of 1.22 between your expected and obtained timer periods.

    Refer to the documentation for the 'Timer.intFreqs' module configuration paramter for more information.

    Regards,

    Shreyas

  • I'm pretty certain that the 6472 timer input is CPU frequency / 6.  It might be possible to get the clock from an external source as well.  The data sheet should provide details on this.

    The ti.sysbios.timers.timer64.Timer module sets the timer defaults based on the frequency specified in the platform file.  The default evm6472 platform package is set to 700MHz.

    The BIOS.cpuFreq.lo/hi default is also derived from the platform package.

    You have 2 options:

    (1)  make a new platform package with 625MHz.   You can do this with the platform wizard.

    (2)  override the deraults in your configuration file with something like the following:

    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
    Timer.intFreqs[0].lo = 104166666;
    Timer.intFreqs[1].lo = 104166666;
    Timer.intFreqs[2].lo = 104166666;
    Timer.intFreqs[3].lo = 104166666;
    Timer.intFreqs[4].lo = 104166666;
    Timer.intFreqs[5].lo = 104166666;
    Timer.intFreqs[6].lo = 104166666;
    Timer.intFreqs[7].lo = 104166666;
    Timer.intFreqs[8].lo = 104166666;
    Timer.intFreqs[9].lo = 104166666;
    Timer.intFreqs[10].lo = 104166666;
    Timer.intFreqs[11].lo = 104166666;

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.cpuFreq.lo = 625000000;

  • Hi Karl

    Thanks for the above steps. I was having a difficult time understanding how one ties the timer handle to whatever timer the function Clock_create() uses. Looks like you solve that problem by setting every possible intFreq element.

    Also, how do you search a page using the CCSv4 help? I searched from intFreqs using the upper left had box, but once you open a page its found, how can you find "intFreqs" in the page?

    Tried Ctrl F but no search window popped up.

    Some of these pages are fairly lengthy so it would be handy to have a tool for this.

    Cheers

  • I was actually able to use Ctrl-F and use a search dialog to find the keyword 'intFreqs' (see screenshot).  You have to click within the contents of the help browser first in order for the search dialog to pop up. 

    If this doesn't work for some reason, you can open up the API documentation directly in your web browser and search using the browser.  Navigate to C:\Program Files\Texas Instruments\bios_6_XX_XX_XX\docs\cdoc and open 'index.html'.