AnsweredAssumed Answered

Timer set up as Quadrature encoder - question

Question asked by Brian Dang on Sep 1, 2017
Latest reply on Sep 8, 2017 by Brian Dang

Board: NucleoF722 with STM32F722

I'm using TIM5 for quadrature encoder counter. I had seen some examples of using CubeMX to do this.

Since I'm interested in quadrature counter, i.e counting 4X the resolution of the encoder disc lines per revolution as generally the case, so I used both input channel TI1 and TI2. The question is why people configured the two input channels trigger polarity as Rising Edge but not Both Edge? Isn't that the Quad counter should count on both edges of each channel (total 4 counts per one period of one input pulse)?  In fact the RM0432 Reference Manual  page 645  for register MITxCCER says: 

"

.......

11: noninverted/both edges
Circuit is sensitive to both TIxFP1 rising and falling edges (capture, trigger in reset, external
clock or trigger mode), TIxFP1 is not inverted (trigger in gated mode). This configuration
must not be used for encoder mode.

"

 

Anyone know why the polarity must be set to Rising Edge instead of Both Edge?

 

A screenshot below was borrowed from other posting member on the same subject, and I posted below as a reference.

 

Best,

Brian

 

Outcomes