It often doesn’t make economic sense to choose a larger microcontroller just to get extra pins so the answer is to use a port expander chip. [Raendra] posted a guide for using one of these chips ...
Also called a "port expander," another example is a USB hub, which allows multiple USB devices to work with one USB port on the computer. See SATA and USB. THIS DEFINITION IS FOR PERSONAL USE ONLY.