2

I am using both Arduino nano and Arduino mega boards in my projects. I got a nasty surprise the other day when I learned that, on the nano, Analog pins 6 and 7 can not be used as digital pins.

Are there any Analog pins on the mega that can not be used as Digital?

Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
Hoytman
  • 747
  • 5
  • 13
  • 27

2 Answers2

3

No, the ATmegaXXX0 has no analog pins without GPIO capability.

Additionally, the ATmegaXX8PB adds GPIO capability to the other analog pins plus a couple of the supply pins, so if you can convince someone to slip one of those on instead then you will gain two GPIOs (a respin will be required to access the ones on supply pins). Note that the core will also need to be modified, but it's only a couple of quick changes.

Ignacio Vazquez-Abrams
  • 17,733
  • 1
  • 28
  • 32
2

On https://www.arduino.cc/en/Main/ArduinoBoardNano it says:

Analog pins 6 and 7 cannot be used as digital pins.

There is no such corresponding statement on https://www.arduino.cc/en/Main/ArduinoBoardMega2560 and judging by the datasheet all of the analog pins can be used as digital pins.

Nick Gammon
  • 38,901
  • 13
  • 69
  • 125