2024-04-22 04:00 AM
Let me start by saying:
Basically I'm after an STM32 that will allow me to interface the maximum number of rotary encoders possible into timer inputs (no I do not want to bit-bang it).
That's it - any suggestions welcome!
2024-04-22 04:22 AM
Usually any regular TIM the has 2 pins/channels. Most will 16-bit
At most only 2 32-bit TIM
2024-04-22 04:26 AM
Lots of timer channels that have 2-pins are up-count only, for example G071 has TIM1,2,3,4,6,7,14,15,16,17,and LPTIM 1 & 2 but only 4 timers out of that lot can actually work for encoder inputs (TIM1,2,3,4) hence my question.
2024-04-22 04:44 AM
AN4013 would be a good place to list available timers with encoder mode or at least the up/down count possibility.
2024-04-22 04:53 AM
As only Advanced control and General purpose can count up/down, what about adding up both number in table 2/3/4 of AN4013 to get the number you want?
2024-04-25 03:06 AM
It's not only advanced & GP timers though - LPTIM1 on G071 can do encoder mode but other GP timers cannot - and I've not audited the entire range to see if LPTIMx on other MCU's can do encoder mode or not.
The encoder feature seems to be somewhat inconsistent across timers/MCU's hence my question - it's not clear to me if it depends on number of pins etc...
2024-04-25 03:35 AM
Add all LPTIM where you have access to both input pads. Probably LPTIM appeared first in F410 and it already has encoder mode as shown in the block diagram
2024-04-25 03:53 AM
A little bit OT / probably not helpful:
About 2 years ago I tried to add a special kind of pulse measurement to the audio / measurement data, synchronized to the audio sampling, options for IE included. The synchronization actually killed it, took too much CPU power to fiddle pulse / IE data into the audio stream.
So I finally came to the conclusion that our current FPGA-based solution (just switched from Xilinx to Efinix) plus MCU was still the better solution.