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.

Edit Platform for SYS/BIOS Project

Other Parts Discussed in Thread: AM1806, SYSBIOS

Recently I built a new platform for an SYS/BIOS project. On the Edit Platform page (see below) it list the Clock Speed as one of the device details. How is this value used by SYS/BIOS? Is the value the external XTAL clock connected to the CPU or after the internal PLL? What is the relationship between this value and the tick timer value in the Task_sleep() BIOS call?

Using CCS V4.2.4, SYS/BIOS v6.32.5.54 , XDCTools v3.22.4.46

  • The Clock Speed (MHz) specifies the CPU speed.  The speed the the core executes instructions.

    I'm not familiar with the clock structure of the AM1806, but I suspect that the timers have a different input frequency.

    You need to program the PLL subsystem yourself to set up the PLL to generate this output frequency.   The .gel files usually include some code to initialize the PLL.  This code can be modified and used in a "reset function" or in main to program the PLL.   Look at xdc.runtime.Startup module to see how you add a reset function.

    -Karl-

  • Thanks, I modified the get file to set up the CPU clock and internal PPL's. Question now is when calling Task_sleep(1) in SYS/BIOS how does the variable in Task_sleep() relate to the clock speed. I assume that SYS/BIO sets up the timer (seems to run OK) but I'm not sure how many clock cycles SYS/BIOS is using for a tick timer and I can't find it in any of the documentation.

     

  • Task_sleep() is driven by the Clock module.   The Clock module's interrupt is driven by the Timer module by default, and the timer is programmed to 1ms by default.   So, Task_sleep(1) will timeout in less than 1ms.   If you want to sleep for between 1 and 2 ms you should specify 2.

    You can change the Clock frequency via the 'Clock.tickPeriod' configuration parameter which you can update in your .cfg script or via the GUI configuration tool:

    You can also specify a different source for the tick.  If you have a periodic interrupt of your own, you can call Clock_tick() from that ISR.   Or, you can disable the clock tick altogether.  The clock tick is only required if you call Task_sleep() or Semaphore_pend() and other xyz_pend() calls with a non-zero timeout.

    You can brute force verify the timeout period by specifying a large sleep (10,000 for 10 seconds), and running using breakpoints and stop-watch before after the call to Task_sleep().

    You can also verify your frequency with the following code:

     

    #include <ti/sysbios/knl/Clock.h>

    #include <ti/sysbios/hal/Timer.h>
    #include <xdc/runtime/Types.h>

     

    .....

     

        timer = Clock_getTimerHandle();
        Timer_getFreq(timer, &freq);

        System_printf("Timer count frequency is %d Hz.\n", freq.lo);

        System_printf("Timer period is %d counts.\n", Timer_getPeriod(timer));

        System_printf("Timer interrupt rate is %d Hz.\n", freq.lo / Timer_getPeriod(timer));

     

    Make sure that your .cfg file has these useModule statements:

    Clock = xdc.useModule('ti.sysbios.knl.Clock');
    Timer = xdc.useModule('ti.sysbios.hal.Timer');