cancel
Showing results for 
Search instead for 
Did you mean: 

Rotary Encoder using STM32F103C8T6

JPanc.1
Associate II

I am using STM32F103C8T6 MCU. I have Rotary Encoder having 5000 Pulse Per Revolution.

I want to count Encoder Pulses and uses only one output from encoder channel A.

I also want interrupt after particular number of pulses for example after 17000 pulses I want interrupt.

I am currently doing by using Rising Edge External interrupt method but not getting proper result.

Now, I want to do it using timer encoder mode but doesn't know how to do it.

So I need example or steps for it.

3 REPLIES 3
Uwe Bonnes
Principal III

You should use a 2 channel timer in encoder mode. Sample the counter often enough. Generate some signal based on these samples.

JPanc.1
Associate II

Any example code??

Uwe Bonnes
Principal III

AN4013?