I need do communicate atmega88 with a smartphone via bluetooth using a bluetooth HC-05 module. The problem is that all my atmega pins are being used. Rxd and txd pins are being used by a keypad (Keypad at PORTD). My project is almost done, at this stage i don't want to change the micro. Is there any alternative to solve this problem? Thanks
The code you're using for the atmega88 should be almost directly compatible with an ATmega328P, I suggest you pick one of those up.
Also you can try to:
Use shift registers/IO expanders:
You can't magic more pins out of thin air.
There are basically two options open to you:
- Don't use so many pins
- Use a different MCU
You could move some functions off the main MCU and on to an external IO expander or shift registers, which means re-designing most of your project, or you could just use a bigger MCU which means only making comparatively minor changes to your project.