2021-05-03 12:37 PM
I'm trying to connect a quadrature encoder to my board using STM32L4R5. From what I understand, I should connect the A and B to TIM2, TIM3, TIM4 or TIM5.
Thank you.
2021-05-03 12:56 PM
Separate encoders need to be on separate timers.
The encoder doesn't have hardware support for an index channel, you'll need to connect it to a GPIO pin as an external interrupt and program the appropriate logic within there (e.g. set timer index to 0 on first occurrence, or similar). Doesn't matter which pin you use for this. ETR and EXTI are different.
2021-05-04 01:57 PM
If the index signal is entirely placed between two consecutive edges (i.e. there's no edge occurring during the duration of index pulse), you could connect it to TIMx_ETR and use the slave-mode controller to automatically reset the counter upon that pulse.
But I don't think you would want to do that.
---
Individual EXTI pins have to be of different "number", e.g. PA0 and PB0 can't both be EXTI source.
JW