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

  • Chances are with a bit of cleverness you can use some of those pins for more than one purpose. If you simply wanted more pins without changing the software architecture, you could go to the surface mount version (which at least in the `328 gets you two more pins), or up to the ATmega1280 or ATmega2560 which gets you a lot more. May 17 '15 at 18:41
  • 1
    Could you post a schematic of your current connections, that way we can see if there are any solutions applicable for you.
    – Paul
    May 17 '15 at 18:54

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:

Multiplex pins:



Use shift registers/IO expanders:



You can't magic more pins out of thin air.

There are basically two options open to you:

  1. Don't use so many pins
  2. 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.

  • Truth hurts xD. Thanks for your response. Which micro (atmega family) do you recommend for minimal changes? Thanks again
    – John P
    May 17 '15 at 17:46
  • Impossible to say, since I don't know what your project is., what its requirements are, whether you are limiting yourself to through hole, etc. Look around on Atmel's site - there's lots to choose from.
    – Majenko
    May 17 '15 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.