Can I clarify that nano pins A6 and A7 cannot be used as digital outputs?

After much frustration, I came to understand that the analog pins A6 and A7 cannot be used as digital OUTPUTS. Is this correct?

Oh Sorry, this seems to have been asked to death. I should have checked before posting :frowning:

I thought my soldering had gone bad. Apparently I need another way to test the pins. That might be a better question.

As you have discovered, those two pins cannot be used as outputs of any kind. You can, use them as analogue inputs and use the value returned as a digital input with a single line of code to interpret the analogue value

Yes. They go directly to the ADC multiplexer. There are no digital buffers, so they cannot be used for digital I/O. The details are in the data sheet - but not particularly obvious.

1 Like

Input only, on the Nano classic.

Nano Every, not so much.

Analog read, and comparison to thresholds? I find A6 and A7 to be extremely useful for options settings.

If you'd like to turn off the flood of responses, then flag someone's response as a solution.

Oh yeah! I was on a roll with a for-loop using the pins as 2-21 after I soldered it. I put a bunch of leds in a row. I first started with the d2-d13. Then I realized you just state the analogs as 14 onwards for analog pins.

I got that much worked out. Then I got really frustrated with 20 and 21. I thought I must have busted up on the soldering! But when I realized neither 20-21 was working, I kind of sussed it. I was going wild trying to work out if the jumper cables were busted or something.

I got really mad!

Oh I dont mind about that. But yeah I might just post it as solved.

You may want to use proto boards and pin headers instead of soldering directly to the board. No chance of bricking a board.

1 Like

The boards I got came with the headers. I wrote another post a while back about being worried about headers. I had to solder the spikey things onto it, the headers. I’m not so scared about it now. Just need a steady hand. Oh I found a really cool trick as well, just put the headers into a breadboard, and then solder them!

1 Like

If you mean that you use pin numbers 14 onwards when using them as digital pins there is no need to do that. Just use the normal pin names, ie A0, A1, A2 etc

If you really want to confuse yourself try

int a = analogRead(0);

to read analog pin A0 and it will work

Breadboards are not designed to be heated.
What are you soldering relative to the breadboard

A female hdr is soldered to some sort of proto board. I will attach pictures of a few at the end.
One very cool board is a solderable version of a breadboard. That allows you to prototype in a standard breadboard then when working transfer it to a permanent board.
These are all amazon.ca, change the .ca to your country
https://amz.cx/3WFI
https://amz.cx/3WFJ
https://amz.cx/3WFK
https://amz.cx/3WFL
https://amz.cx/3WFN
and lot's more, just do 'related' searches.

If you get a Nano with an ATmega328PB instead of an ATmega328P (some of the "clones" are doing this because the PB is cheaper), then a6 and a7 CAN be used as digital IO.

1 Like

In the Nano Every A6 and A7 exist and can be addressed as digital pins 20 and 21. There are many boards with the name Nano having different microcontroller chips.

Oh. I think I got a knock off. Its no big deal. I will just work with what I have. I was mainly just making sure all the pins worked.

Yes, it is old trick for soldering pinheaders (in 0.1 inch distancies) to use old breadboard as holder.

This keeps the pins nice perpendicular to the soldering points and paralel each to other, even when the spaces are many and pins are sparce :slight_smile:

I have some article about it here - in Czech - with photos attached: Indikátor Napětí - Mix

Some pictures of work in progress: closeup and final product

I have used breadboards as a header soldering jig before. However, I was not happy with it for several reasons:

  • The pins in the male headers can move vertically within the plastic spacer when you are pressing the header into the breadboard, or when removing the header prior to soldering if you need to reposition it.
  • The large metal strips inside that make the contacts act as heat sinks and so make soldering the headers more difficult, time consuming, and can result in lower quality joints.
  • The header can be held at an angle, which results in the header not being aligned perfectly perpendicular to the PCB after soldering.

A better solution is to get a few sheets of perfboard and use machine screws to mount them together in a stack. The boards often come with mounting holes at each corner, which makes it easy to do, but you can also easily drill holes for the screws if needed.

You can then use that as a base to hold headers, place the PCB over them, then solder.

The reason I recommend using a stack of multiple boards instead of only a single board is this ensures correct alignment of the headers. With only a single board, there is more freedom for the header to move angularly due to the fact that the pin is only constrained over the short distance of a single board's thickness. So it is possible to end up with headers that aren't perfectly perpendicular to the PCB after soldering when using a single layer of perfboard. Adding more layers of boards makes it so there is very little freedom for the header pin to be angled, ensuring perfect alignment when soldering.

It is best to use the perfboards that are pure substrate without plating:

📷

6 Pack 1,160 Holes Perf Board without Solder Pads, 3" × 4" (76.2 x 101.6mm) by Science Purchase

However, the ones with only surface pads will work pretty much just as well (because there isn't much metal, and also won't be much contact between that metal and the pin), and are more commonly available:

📷

Lochplatinen.png by PeterFrankfurt - public domain

I don't recommend using the plated through hole type of perfboard/protoboard for this purpose since the plating inside the holes will have significant contact with the header pin and so will also act as a heat sink:

📷

Hitachi HA12157 Dolby B-C IC on a perfboard.jpg by "Retired electrician" - CC0 1.0 (cropped)

Likewise, I would not recommend using stripboard, but the common non-plated through hole variant will work reasonably well if it is all you have on hand:

📷

StripBoard.png
by Klaus - Günter Leiss - CC BY-SA 3.0

4 Likes

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