AnsweredAssumed Answered

How to cascade Encoder and Input Capture Mode

Question asked by Janvi on Jul 24, 2012
General Purpose Timer 4 counts the position from incremental encoder in quadratur mode. The Encoder has 200 slots and for low speeds, the frequency is rather low. To derive the rotation speed, I subtract 2 positions in distance of 100 msec. Unfortunately, the accuracy is becomes too low for slow speeds. Therfore, the project has a free Timer 2 what can be initialized in input capture mode. The result will be probably a more accurate meassurement of elapsed time between 2 encoder slots.

Therefore I need to cascade Tim2 as a slave to Tim4. Each clock of Tim4 should trigger a capture event at Tim2. If I use extra CHx input pin for additional input connection of encoder A or B signal, only 1/4 resolution is used for speed calculation. Using internal Master - Slave setup would be helpfull. How to setup this ?
 

Outcomes