Arduino Nano Every pwm pin issue

Hi! I recently bought some Arduino nano every board's, on the pin out and box it's list as 6pwm pin (D2,D3,D5,D6,D9,D10), but D2 it's acting like a regular digital pin, what can I do to output pwm signal, it's is a tipping issues from Arduino or it's needs some special software implementation??

You need to use analogWrite in the code you didn't post.

Pin 2 is not a PWM pin.

Check the reference

Edit: I missed the "Every" reference ( I thought it was a typo). Sorry.

The confusion is understandable. The pin out diagram shows the pin as ~D2 implying pwm is available.

I think you should be able to get D2 as a PWM.
I think the libraries don't allow this currently (analog write wont work).
If you read the docs, and write the registers "manually" that should work.
Section 19 TCA of megaAVR® 0-series
Section 14 Port multiplexer
Section 16 Port IO configuration

Someone really good (ben84) posted a sample code in high frequency PWM
topic: Nano Every PWM frequency - #5 by Ben84 - Nano Every - Arduino Forum

Greg

1 Like

D2 is not a PWM pin. There are only 5 in the Arduino Nano Every -- 3, 5, 6, 9, and 10. That's one less than on the Arduino Nano/Uno as pin 11 is not a PWM pin.