INB4: if this question doesn't fit this board, please delete. But I don't know where else to ask.
There're plenty of I/O port expanders available. Most of them add 8 I/O lines at the cost of two I2C lines (SDA, SCL). Here's the pinout for the MCP23008, taken as an example:
And here we have a pinout of ATtiny404 MCU:
The chip has 12 I/O lines, from which:
- Two lines are for I2C, connected to hardware I2C module;
- One line is reserved for RESET;
- One line can be used to generate interrupts for external MCU;
- 8 general purpose I/O lines.
So such MCU can easily substitute dedicated expander like MCP23008 or any of a kind. It will of course require some programming to do so. I self-rank my own programming skills somewhere between 'awful' and 'very poor', and still I think it will take me maybe 4-5 work days to write such firmware. Experienced programmer, I guess, can make it in 1-2 days. I see no obstacles here.
While for the Arduino guy (like me) simplicity is very important, in full scale production cost control comes to the first place. And what we have for the MCP23008? Here's offer from Digikey, roughly $8,000 per 10,000 pcs: https://www.digikey.com/product-detail/en/microchip-technology/MCP23008T-E-SO/MCP23008T-E-SOTR-ND/739286
And here's for ATtiny404, roughly $4,300 per 10,000 pcs: https://www.digikey.com/product-detail/en/microchip-technology/ATTINY404-SSNR/ATTINY404-SSNRTR-ND/8594960
That means that for 10,000 pcs price difference is about $3,700. And 10k pcs isn't a breathtaking amount for a production device.
So the question is: what is the reason that such devices are not completely phased out by MCUs?