I'm trying to find the best way to get five more digital I/O pins back in a particular design I'm working on (the kit form of the Keyglove, actually), since I've run out of pins and I really need those back. I'm using the AT90USB1287 MCU, and everything is pretty much maxed out. I have a number of I2C devices on the bus though, so if I can find an I2C-based solution, that would be ideal.
The five pins in question are currently being used for the following tasks:
- Red component of RGB LED (active high)
- Green component of RGB LED (active high)
- Blue component of RGB LED (active high)
- Vibration motor on/off control (active low)
- Piezo buzzer frequency control (either off or some pitch creating by the Arduino tone() function)
I need to move all of these to some external chip. I know there are plenty of I2C I/O expanders out there that would have no trouble at all with tasks 1-4 above. However, I'm not sure if there is anything out there that can do 1-4 and take care of the a tone()-like solution to control the pitch of piezo buzzer.
Does anyone know if such a device exists? I'm looking for something that is a very small 8 to 16-pin QFN or SSOP that is not more than ~$2. Would it be possible (or necessary) to use an ATTiny MCU for this task--something that is built to use to I/O pins for bit-banged I2C device emulation and VERY simple communication protocol, then 4 digital I/O pins for RGB/vibe control and one along with the 16-bit timer for tone()-like pitch control. Maybe an ATTiny24?