I am trying to configure a 1ms system clock for:
- TMDSEVM6670LE,
- XDS560V2 mezzanine
- CCS6.0
- Sysbios 6_33_06_50
The example below runs for 60s if the clock period is set up correctly at 1ms. In the .cfg file provided with the original example, a clock is defined with Tick Period (us)=1000, and no timer is defined. Using these settings, the clock is updated every 8ms instead of 1ms measured by the time it takes the example to run to completion. If I change the clock Tick Period(us) to 122 instead of 1000, the clock is updated approximately every 1ms, and the example runs for 60s as it should.
// Simplified example from bios_6_33_06_50\packages\ti\sysbios\examples\generic\clock\clock.
Void main()
{
Clock_Handle clk1;
Clock_Params clkParams;
Clock_Params_init(&clkParams);
clkParams.period = 0;
clkParams.startFlag = FALSE;
clk1 = Clock_create(clk1Fxn, 60000, &clkParams, NULL);
Clock_start(clk1);
BIOS_start();
}
Void clk1Fxn(UArg arg0)
{
UInt32 time;
time = Clock_getTicks();
System_printf("System time in clk1Fxn = %lu\n", (ULong)time);
System_printf("Calling BIOS_exit() from clk1Fxn\n");
BIOS_exit(0);
}
I haven't found an explanation of how a timer is connected to a clock in SysBios references. I'm especially interested in eventually setting up the 1ms clock in startup code without using a .gel file.
Questions:
- How does changing Tick Period(us) from 1000 to 122 in the example produce a clock period of 1ms?
- Which timer does SysBios use as the default if a timer isn't specified?
- Where is this default timer configured in SysBios?
- If SysBios uses the timer configuration in evmc6670l.gel, where does it read these values?