Expanding Attiny microcontroller with shift register

Attiny microcontrollers have small footprint leading to smaller number of I/Os available. These microcontrollers are meant to control simple things like reading sensors, driving relays and so on. If you come to the point where you need more I/O pins then there are two options – use bigger microcontroller or expand number of pins with port expanders or with simple shift registers. For smaller microcontrollers port expanders may be too costly solution, because of limited memory it may require to much of driving like I2C or SPI expanders. In this case better solution is to use shift registers that can be driven pretty easily with not much overhead code and you can get as many pins as you want by connecting them in cascades. silentbogo wrote a simple instructable on how to interface shift register to Attiny microcontroller (same apply to other micros like PIC12). Register of choice here is standard 74HC595 which is cheap and available everywhere. Depending on what level control you want, there can be various control scenarios. You may want to have master reset(MR) or output… Continue reading