Quadrature enable disable

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Quadrature enable disable

582 次查看
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.

标签 (1)
0 项奖励
回复
1 回复

472 次查看
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 项奖励
回复