D12 output digital only, not analogue?

Long story short: Had a strange issue with a project and traced the issue to output from pin D12 not working as analog. All the other D pins seem happy to work as digital or analog.
Discovered this on a Nano, but then found it's the same on Uno.
Seems odd.
Can't find anything mentioned about this on the forum.

pinMode(12, OUTPUT);
analogWrite(12, i);
with increasing value of i, output just flips from 0 to 1 (0v to +5v)

Any ideas?
I can't beleive I'm the only one to have found this. I'm sure I must have missed something obvious!

What you have found is no surprise

1 Like

Hi, @timo11001101
Welcome to the forum.

Also note the "analog" outputs on a Nano and UNO are PWM digital signals, not analog voltage levels.

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Maybe it's because you're the only one who hasn't even bothered to familiarize yourself with the hardware you're using. Besides, there is no particular difference between Nano and UNO because they use the same microcontroller. In the past, the UNO was with a microcontroller in a DIP package and for that there are only 6 analog inputs and the Nano has 8 but only 6 of them also have digital input/output functions and the other 2 are only analog inputs. This is just to add to the previous posts.

Aha! Of course. Now I can see it staring me in the face!
I knew I must have missed something obvious.
Thanks! :slight_smile:

I am intrigued as to how you came to the conclusion that

when it is not the case

1 Like

Ouch! :fire:

It's a fair cop! Should have said the other D pins I tested, ie 9,10,11. Didn't test them all. If I'd got as far as 8, I guess I'd have realised! :wink:

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