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;
Hi,
You code seems same as AN5142 quadrature encode example. Do you mean at first it can work correctly, but you can't write new value to FTM2->MOD or FTM2->CNTIN?
https://community.nxp.com/message/323855
Regards,
Jing
the quadrature encoder works just fine after the first init. but when I need to load a new value to FTm->CNT during running. I do the next to load the new value by means of CNTIN
but it didnt work !!.