Setting up Quadrature Encoder

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

Setting up Quadrature Encoder

1,892 次查看
PHXFAE
Contributor II

I have a customer using theMK21FX512VMC12 and is trying to set up the FTM2 for a quadrature encoder. 

The goal is to have FTM2 in the Quadrature Mode where the PHA and PHB clocks come in and increment or decrement the counter. Every 100miliseconds, I want to read the FTM2 Counter value
and direction,  then reset back to the initial value.

To do this: do I have to set the channels up?

Are they only needed to load or compare to the count register?

Do I have to do anything with the mod register?

I see the initial Count value when I read it but I don’t see the counter change with PHA and PHB running.

I added a txt file for the register set up.

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

1,586 次查看
egoodii
Senior Contributor III
0 项奖励
回复

1,586 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

It need to use FTM Quadrature Decoder- Phase A and Phase B Encoding mode.

For there could exist counter increase and decrement situation, please check below picture:

2015-06-30_14-35-21.png

There is a note for the FTM module using with quadrature decoder mode, the FTM channels in input capture and output compare mode.

When BDM is active, the FTM counter is frozen. This is the value that you may read.

So, it need to use the software to read the FTM counter value back.

Wish it helps.

best regards,

Ma Hui

0 项奖励
回复