Setting up Quadrature Encoder

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Setting up Quadrature Encoder

1,894件の閲覧回数
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,588件の閲覧回数
egoodii
Senior Contributor III
0 件の賞賛
返信

1,588件の閲覧回数
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 件の賞賛
返信