Sorry, may be I should have started from the basics...
The encoder mode is a dedicated timer configuration available on TIM2, TIM3, TIM4 and TIM5.
It uses the TIMx_CHy timer alternate function pins of the device.
The TIMx_CHy naming in ST documentation is equivalent to PWMx/y in mbed doc.
A detailed hardware description can be found in the STM32F401 Reference Manual
specifically fig87p305 and section 13.3.12 Encoder interface mode p328-330
The library mentioned in my previous post provides a software interface to the encoder mode of the timers.
Unlike the code graciously provided by Abraham, the encoder is handled by hardware, reducing the jitter introduced by interrupt latency (which is not completely deterministic) and reducing the CPU load... but the working principle is exactly the same.
I am sorry I don't have an example at the moment, let me look for one.
Hi, Does somebody know how to manage with quadrature encoders on a Nucleo F401RE board ? According to the datasheet of its processor, it has the specific hardware for supporting 4 quadrature encoders. I would like to know if somebody has built a library for this or can do the job. My problem is I want to use a Nucleo F401RE board on a robot with two DC motors and two quadrature encoders for feed-back control. Thanks for the answer.