Looking for MCU for handling many encoders

Hello everyone!

I'm currently in a home automation project and I need some help choosing an MCU for a control panel with at least 5 rotary encoders.
I need an MCU that
-Can run from 3.3V
-has enough external interrupts to handle 5 rotary encoders
-relatively cheap $1.5-2
-has an internal oscillator that can be calibrated

Optional, but I'd be very happy to have:
-CRC32

Even better if it has:
-2 or more UARTs
-1 spare SPI (in case it uses SPI for firmware update)
-SWD/JTAG programming interface (I use some SAMD51 chips so I have a few debuggers, but I don't yet have a UPDI debugger)

Arduino IDE support is not a priority, I use Atmel Studio most of the time.

I was thinking about the Atmega4809 but it needs 5V for full speed operation and uses UPDI (which I don't yet know what hardware need to use with), Maybe there's some cheap SAMD chip or something like that.

Thank you for helping in advance!

Can you describe the application a bit? Specifically, what's the expected tick rate from the encoders? Will they be operating continuously? Simultaneously?

Finding a micro with more than one or two QEI inputs might be tricky. The STM32F407 is a nice MCU but has, I believe, only two QEI ports.

Consider external QEI interface ICs. For example, the LS7366:

or

Only problem I can see is that they're are sort of $pendy. But I think finding and implementing an MCU capable of doing this for all 5 encoders (depending on frequency etc) will be expensive anyway.

for which an Arduino library exists: GitHub - davidjabon/LS7366: An Arduino library to interface to the LS7366 quadrature encoder counter.

(not vouching, just saying it's there...)

If your tick frequency is low you might be able to use pin change interrupts and software techniques. If you have continuous operation of faster encoders I think you'll want to stick with a hardware timer based solution.

Blackfin:
Can you describe the application a bit? Specifically, what's the expected tick rate from the encoders? Will they be operating continuously? Simultaneously?

They will be rotated by hand so maybe I'd twist them fast some times but it won't be as fast.

Blackfin:
If your tick frequency is low you might be able to use pin change interrupts and software techniques. If you have continuous operation of faster encoders I think you'll want to stick with a hardware timer based solution.

I was thinking about pin change interrupts or maybe some external circuitry to use it with an internal counter in something like an up/down counter mode if possible.

Using pin change interrupts, even the lowly 328P would support five encoders, although you would have to run it at 8MHz at 3.3V. But it doesn't satisfy the other requirements for an extra SPI, etc.

Another alternative would be to use polling. Checking the pins every two millis or so should work, particularly if you read the ports directly instead of doing digitalReads. Then the limitation would just be having 10 GPIO pins available. Then the lookup table method would give you pretty fast processing of any ticks detected.

Don't know if this'll help but I2C Encoder | Hackaday.io

dougp:
Don't know if this'll help but I2C Encoder | Hackaday.io

It looks good but I have very restricted space and also I want the simplest solution possible.

ShermanP:
Using pin change interrupts, even the lowly 328P would support five encoders, although you would have to run it at 8MHz at 3.3V. But it doesn't satisfy the other requirements for an extra SPI, etc.

I'm looking for something of similar power as it only needs to handle a few sensors occasionally, and these encoders. Maybe there is some newer chip out there with more interrupt handling capability.

The FPGA on the Arduino Vidor can handle up to 11 encoders. https://www.arduino.cc/en/Tutorial/LibraryExamples/VidorEncoder

Hutkikz:
The FPGA on the Arduino Vidor can handle up to 11 encoders. https://www.arduino.cc/en/Tutorial/LibraryExamples/VidorEncoder

It's a very overkill and expensive way to handle encoders, I think. Ad I need to make my own board in the end and I'd not be comfortable to put some BGA stuff on something that needs to work for 15-20 years, without professional manufacturing equipment. I'm actually thinking about an ATMEGA1608

I'm currently in a home automation project and I need some help choosing an MCU for a control panel with at least 5 rotary encoders.
I need an MCU that
-Can run from 3.3V
-has enough external interrupts to handle 5 rotary encoders
-relatively cheap $1.5-2
-has an internal oscillator that can be calibrated

I think one of these fits your requirements nicely. Can keep the clock running at full speed (24MHz) over the full operating voltage range.

-SWD/JTAG programming interface (I use some SAMD51 chips so I have a few debuggers, but I don't yet have a UPDI debugger)

This is inexpensive, also this has everything as it includes a debugger.

How about an xmega32a4?

https://www.mouser.com/datasheet/2/268/Atmel-8387-8-and16-bit-AVR-Microcontroller-XMEGA-A-1315807.pdf

32 Mhz @ 3.3V
lots of timers, USART, and SPI
works with atmel studio and PDI