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.

High precision Timer of DM8168

Hi everyone,

 

   I am a beginner of DM8168, now I want a high frequency clock, which can be programmed and interupted within 1 milliseconds.

   The precision of usleep seems not so high to do this work.

   So, I think maybe I should use the timer hardware on the board to implement this work.

   I found in the kernel, a 27Mhz clock was registed in clock816x_data.c

------------------------------------------------------

static struct clk sys_clkin_ck = {

.name = "sys_clkin_ck",

.ops = &clkops_null,

.rate = 27000000,

.flags = RATE_IN_TI816X,

};

------------------------------------------------------

  But how to use it? Is there any example about how to set the timer ?

  Thank you.

 

Best wishes,

lei

 

  • Hello,

    You can use timer APIs from a kernel module. For example, see "arch/arm/mach-omap2/timer-gp.c" file where 2 timers are being used for system using APIs such as omap_dm_timer_request_specific() etc. Make sure you use a free/unused timer to avoid conflict. Please refer PSP datasheet for the release you are using which would have listed time timers being used. 

    Btw, the PSP release 04.00.00.10 and onwards have high resolution timer support enabled so you should get higher resolution.

    Please check the output of "cat /proc/timer_list " to see the supported resolution. You can also consider using nanosleep() etc (in case from userspace).

       Hemant