µTasker Forum
µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: internship2 on February 18, 2013, 01:16:06 PM
-
Hi i need a timer for checking on a signal. I have be looking at the flex timer from Freescale. Someone now if this is possible to use with uTasker or if uTasker have a better timer?
-
Hi
It depends on what you want to do with the timer.
The uTasker project supports PIT timers (see SUPPORT_PITS) for generating single-shot and periodic interrupts (the Kinetis has 4 of them).
In addition, when the resolution doesn't need to be extremely high the SW timers can be used (based on the Cortex SysTick timer).
The FlexTimers are only supported for PWM generation at the moment (see SUPPORT_PWM_MODULE).
There are examples of the use of HW timers in the file ADC_Timers.h.
Regards
Mark
-
Hi Mark
I wont to receiving a signal, check have many pulses there are in it and the time. I think i have found the solution with this code:
static void fnConfigure_Timer(void)
{
static TIMER_INTERRUPT_SETUP timer_setup = {0}; //interrupt configuration
timer_setup.int_type = TIMER_INTERRUPT;
timer_setup.int_priority = PRIORITY_TIMERS;
timer_setup.int_handler = 0; //interrupt handler on overflow
timer_setup.timer_reference = 2; //timer channel 2 (to se wich one to use) se app_hw_kinetis.h I am using ftm
timer_setup.timer_mode = (FTM0_EXTTRIG); //Timer clock input and edge
timer_setup.timer_value = 0.000002; //u sec. 1/500.000
fnConfigureInterrupt((void *)&timer_setup); //enable PWM signal
}