I am working my way through the SYS/BIOS example projects in an effort to transition from DSP/BIOS to SYS/BIOS for my OMAP-L138 project. I would like to use the Timer module but am struggling with several fairly basic questions.
1. On the OMAP-L138 timers 0 & 1 are driven by AUXCLK, which on my board is 24MHz. And timers 2 & 3 are driven by SYSCLK2, which is 150MHz on my board. How and were are these frequencies specified in bios 6? Do I need to tell bios 6 this information? In bios 5 it is specified on the CLK Manager in the DSPBIOS config tool.
2. I would like to use the Timer_getFreq function. Can someone provide some sample code showing how to get the frequency of the timer? I am struggling with the correct syntax. Here is my test code, which throws an error for Types_FreqHz (undefined). I have created a static Timer (timer1) in xgconf with a period of 500 us which correctly calls myISR.
Types_FreqHz *freq;
Void main()
{
Swi_post(swi0);
Swi_post(swi1);
Clock_start(clk1);
Timer_start(timer1);
BIOS_start();
}
Void myISR()
{
Timer_getFreq(timer1, freq);
System_printf("Current period = %d\n", Timer_getPeriod(timer1));
}
Here is what is generated by xgconf
var ti_sysbios_hal_Timer = xdc.useModule('ti.sysbios.hal.Timer');
var instti_sysbios_hal_Timer1Params0 = new ti_sysbios_hal_Timer.Params();
instti_sysbios_hal_Timer1Params0.period = 500;
instti_sysbios_hal_Timer1Params0.instance.name = "timer1";
Program.global.timer1 = ti_sysbios_hal_Timer.create(1, "&myISR", instti_sysbios_hal_Timer1Params0);
3. I have specified a period of 500 us in the static config but the code above returns a timer period of 12000. What am I doing wrong?
Your guidance is appreciated.
Thx,
MikeH