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.

customize the clock frequency of clock module by *.cfg file

Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hi Champs,

              Could I customize the clock frequency to generate bios tick for clock module by *.cfg file? I tried this way but failed: 

               1      set TimerID as 0 on clock module configuration.

                2      new a timer and set the frequency, the timerID is the same as clock module. 

              Then the CCS5 will generate error info that timer0 is already used.  

               The bios version is 6.32.05.54. 

               Any tips to set the frequency? 

               Thanks a lot for your help! 

               Jane

               

 

  • In your config file you can set the period of the Clock module's tick using:

        Clock.tickPeriod = 10000;  /* set period to 10ms.*/

    Alan

  • Hi Alan,

                   I'd like set the timer frequency rather than the tick period. For example, I would like use 20MHz clock to drive the timer rather than use the DSP's internal 1GHZ clock, how to configure the timer's frequency?

                   Thanks again for your support! 

                   Jane

  • I don't know which device you're building for but none of the dsp devices we support run their timers at the DSP clock frequency.

    Common default timer frequencies are 32KHz, 19.2MHz, 20MHz, 24MHz, 27MHz, etc...

    For example, the OMAPL138 device runs its timers at 24MHz.

    Which device are you building for?

    Alan

  • Alan,

                    The device is TCI6614.  I'd like double confirm that SYS/BIOS do not support use external clock frequency to calculate bios tick? Thanks a lot! 

                     Jane

  • I think I understand what you're trying to do now.

    If you want to configure the timer used by the Clock module to use an external clock source try adding the following to your config script:

    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    Clock.tickSource = Clock.TickSource_USER; /* user provides the timer * /

    /* Create the timer and set it to use an external clock source */
    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
    var timerParams = new Timer.Params();
    timerParams.period = 1000; /* 1ms period */
    timerParams.extFreq.lo = YOUR_EXT_CLOCK_FREQ_IN_HZ; /* selects ext clock source and frequency */
    Timer.create(Timer_ANY, Clock.tick, timerParams); /* call Clock module's tick handler */

    Alan

  • Alan,

                   Thanks, it solve my problem! 

                   Jane