HI All,
I am using SKEAZN64MLC controller in my project,
Now i need to implement some timer logic for my requirement.
I need to keep on count the timer count value, once counter value greater than some predefined value , then i need to stop timer.
and again start the timer by count value initializing to 0.
1. How to start and stop flex timer?.
2. How to initialize the timer to count for 1 us.?.
void FTM_Init()
{
SIM->SCGC |= SIM_SCGC_FTM2_MASK; /* Enable Clock for FTM2 */
FTM2->SC |= FTM_SC_PS(3);
FTM2->SC |= FTM_SC_CLKS(3); /*FTM2 use system clock*/
// external clock is 8MHZ so 8/2^3=1mhz so timer increment for each 1 us.
}
is this correct?.
3. is timer count will automatically update to FTM2->CNT or need to capture every time?.
Basically i need to set of sample codes for flex timers , kindly share to me.
Hello ,
Which IDE do you use ?
If you use KDS, i recommend you create one PE project , then add the "Init_FTM" component or "TimerOut_LDD" component ,
then generate code , you can find the configuration about the FTM.
Hope it helps
Alice
Hello ,
Call the function spi_init() ???
If you want use the flex timer , please add the component of "Init_FTM" or "TimerOut_LDD",
then configure it , then click generate code button here :
then you can fund the generated code here :
If still have any question, please send your project to me . I use KDS3.0 .
Hope it helps
Alice