I have noted on more than one occasion the comments in sketches "reserving pin 13 for future PWM backlight dimming of the LCD" while using Uno and Nano boards. Am I missing something ? I always considered it NOT possible as PWM output is only available on pins 3,5,6,9,10 and 11 on most boards.
asked Nov 17, 2018 at 20:01
Alan MitchellAlan Mitchell
-
Have you checked schematics and processor datasheets? That pin may be backed with PWM hardware, but not be supported by Arduino software for the reason stated. Remember that an Arduino is a product of a little self-contained ecosystem with certain design goals in mind.TimWescott– TimWescott11/17/2018 20:06:35Commented Nov 17, 2018 at 20:06
-
you can program any pin to output a PWM signaljsotola– jsotola11/17/2018 20:18:48Commented Nov 17, 2018 at 20:18
-
yes, but analogwrite() only works with those pins backed by hardware PWM circuitry on-chipJasen– Jasen11/17/2018 23:01:24Commented Nov 17, 2018 at 23:01
1 Answer 1
Arduino pin 13 is SCK/BP5 on the ATmega8 MPU, there's no hardware PWM capability on that pin, so any PWM would be software driven.