Encoder mode
Hello everyone,
I am currently working on encoder mode with an STM32C031. I am using a DC motor with an incremental encoder and a gear reducer. My goal is to measure both the velocity and position of the motor.
I have configured Timer1 with a frequency of 24 MHz, using channels 1 and 2 in quadrature mode to read the encoder signals. However, I am struggling to understand the relation between the timer frequency configuration and the values provided by the encoder.
Additionally, I am uncertain about how to correctly set the timer period for the encoder. Currently, I have set it equal to the timer period, but I am not sure if this is the correct approach.
I would appreciate any insights or explanations regarding:
- The correct relationship between timer frequency and encoder output.
- How to properly choose the timer period for the encoder.
Below is my current configuration:


Thank you in advance for your help!
