Nano A6/A7 as Digital I/O - Reference needed

I find conflicting info on the Web (surprise!). Some sources indicate that A6 and A7 may be used as D20, D21, (some indicate inputs only while others just call them digitals) while others indicate they are analog inputs only. In my application I’d like to have 8 DI, 10 DO, TX, RX, SDA, and SCL. While SDA and SCL can be sacrificed, I’d like to preserve them.
So, can A6 and A7 be used as any form of digital input (yes, I know, I could read an analog value from them, but that’s A) slower, and B) not very intuitive).
Is this perhaps a difference between genuine and clone Nanos?

Comments? I know, I’m using a Nano to the max this way, but is it possible?
Thanks
B

From the digitalWrite() reference:
https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/#_notes_and_warnings

The analog input pins can be used as digital pins, referred to as A0, A1, etc. The exception is the Arduino Nano, Pro Mini, and Mini’s A6 and A7 pins, which can only be used as analog inputs.


Nope. The same applies to any board that uses an ATmega328P microcontroller, regardless of who made it.

1 Like

They are analog input only on that board.

Thanks Larry, Pert. That must be ‘bleedover’ from the definitions of other Arduino instances, then. Guess I’ll have to shiftregister a handful of digitals, then. Sigh. So close.
B

This started my confusion. It looks like an official Arduino image…
The pinout diagram on the documentation tab at this page:
https://store.arduino.cc/usa/arduino-nano
which seems to appear in several places on the web.
Oh well.
B

1 Like

Thanks for reporting this @camsysca! I have submitted a formal bug report about it here:

The only official reference is not the web, Youtube is even worse, but the microcontroller datasheet which can be downloaded from the Microchip site.
On 328P there is no more space available on a digital port to connect the two available analog multiplexer inputs to it.
These two analog inputs A6 and A7 are not available on the UNO because the DIP28 case does not have enough pins available. It is possible with TQFP SMD case because it has 32 pins.
It is regrettable that Arduino did not switch from 328P to 328PB which has an additional digital port.

Wow. You really expect everyone who comes here to read the datasheet for the underlying controller? Really? Honestly? As an old I&C tech, I get where you’re coming from, I really do, but your expectation is a tad unrealistic, in my humble opinion. I’m not picking a fight, but c’mon.
B

But we read datasheets all day to answer the questions, and this forum is not a datasheet-reading-service. So yes, open a datasheet once in a while.

Thank you, Pert, for acknowledging the problem and doing something about it.
B

You do like you want.
I tell you that the best documentation is that of the one who designed the microcontroller.
If you prefer something else, no problem, it is your problem.
But you will still run the risk of having documentation from the “self-proclaimed expert” who actually knows less than you do.

Just because the datasheet is the most definitive document, doesn’t mean that other documentation shouldn’t be CORRECT as well… (Especially if it’s supposedly official and maintained by someone…)

1 Like

You can possibly move two of the other digital inputs to A6 and A7 and obtain a boolean result. Something like:

bool dr = ( analogRead( A6 ) > 512 ) ;  
1 Like

Yes, but in this case you have to choose carrefuly documentation origin.
Don’t forget In this exemple web says that A6 and A7 are numericals.
Proof that origin of this WEB information was very bad.

During many years Arduino said Max current per pin = 40 mA → mistake between Absolute Maximum Rating and standard values.
Now it is good : 20 mA max per I/O, and very important: 200 mA max for Gnd and Vcc.
But It is not write that at 20 mA, output voltage can not be Vcc but (Vcc - 0,4 V) due to output CMOS Rdson. Datasheet shows this.
So even Arduino can mistake.
It impossible to Arduino to give a complete information.

IMO chapter “Electrical Characteristics” must absolutly be read.

I have seen many projects that think the 40mA absolute current limit, is the limit of what the pin will give and not the point where damage occurs when you exceed it. They use that as an excuse for not using a resistor with an LED. This was compounded by a vert early photograph showing an LED sticking into pin 13 and ground. In this care there was an onboard resistor which was removed about 15 years ago from Arduino boards, but like a zombie it can never be killed.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.