Hey all y'all:
So the STM32s have this feature where the quad encoder signals at the MCU pins can not only be sent to the typical timer configured as a quad encoder peripheral to keep count of the encoder position, but also to an input capture peripheral that can measure the speed of the encoder tick-by-tick. The input capture can be set to trigger every event up to every 8 events.
[EDIT: IT'S A GENERIC INPUT CAPTURE, NOT ONE SPECIFIC THE ENCODER MODULE]
My question is...even if the input capture ISR is dead simple (just writing the input capture value to memory so that the main program loop can read it), it completely bogs down the processor with the same interrupt firing at 10kHz to >100kHz. Even if it's only set to trigger every 8 events. It's not surprising I guess but what's the point of this mode then? I am using an encoder with 4096 transitions per revolution so was this feature this just intended for much lower resolution encoders or much lower speeds? Or am I missing something?
Let's ignore alternative methods of speed measurement right now, such as anything using the index pulse.
So the STM32s have this feature where the quad encoder signals at the MCU pins can not only be sent to the typical timer configured as a quad encoder peripheral to keep count of the encoder position, but also to an input capture peripheral that can measure the speed of the encoder tick-by-tick. The input capture can be set to trigger every event up to every 8 events.
[EDIT: IT'S A GENERIC INPUT CAPTURE, NOT ONE SPECIFIC THE ENCODER MODULE]
My question is...even if the input capture ISR is dead simple (just writing the input capture value to memory so that the main program loop can read it), it completely bogs down the processor with the same interrupt firing at 10kHz to >100kHz. Even if it's only set to trigger every 8 events. It's not surprising I guess but what's the point of this mode then? I am using an encoder with 4096 transitions per revolution so was this feature this just intended for much lower resolution encoders or much lower speeds? Or am I missing something?
Let's ignore alternative methods of speed measurement right now, such as anything using the index pulse.
Last edited: