AnsweredAssumed Answered

loading an instant value to ftm.CNT counter value while counting in quadrature decoder mode

Question asked by Amer Zater on Oct 29, 2019
Latest reply on Nov 20, 2019 by Jing Pan

I am using FTM2 on MKV10z32 as quadrateure decoder . and some times while running I  re-synchronize the counter with a specific value and continue counting in the quadrature decoding mode from 0x0000 to 0xffff

 

I am using the next code to load the instant value(x) . but it seems that it dosnt work:

 

FTM2->SC=0x00;
FTM2->MOD=0xFFFF;
FTM2->CNTIN=x;
FTM2->CONTROLS[0].CnSC=0;
FTM2->CONTROLS[1].CnSC=0;
FTM2->QDCTRL|=0x01;
FTM2->MODE|=0x05;
FTM2->SC=0x48;
FTM2->CNTIN=0;

Outcomes