Quadrature enable disable

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Quadrature enable disable

476 Views
riteshunde
Contributor I

Hello,

I am using quadrature mode with k22fx512vmc12, it works fine with encoder.

But when I disable and enable it again, FTM counts starting phase shift in between phase A and phase B which is not desired as encoder is at steady state (i.e. either 01, 10 or 11).

I am using following code to enable again,

FTM1_QDCTRL = (FTM_QDCTRL_QUADEN_MASK);

and to disable again,

FTM1_QDCTRL = 0;

Your help will be appreciated.

Labels (1)
0 Kudos
Reply
1 Reply

366 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thank your for your interest in NXP Semiconductor products and the opportunity to serve you.

After had a brief look through the statement, I'd like to suggest that you can try the code below instead of the original.

Disable the Quadrature Eecoder Mode

FTM1_QDCTRL &= (~FTM_QDCTRL_QUADEN_MASK);

Enable the Quadrature Eecoder Mode

FTM1_QDCTRL |= (FTM_QDCTRL_QUADEN_MASK);

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply