Arduino DUE pwm pins

Hello. I bought arduino due few days ago. Datasheet says that DUE has pwm on 2-13 pins. But it's written on the pins 22-53 that there are pwm too. Are that pins works with pwm?

Hello s1stemdev

Welcome to the best Arduino forum ever.

Give them a try and code a test programm simply.

You have a defined macro digitalPinHasPWM ( n ) ) that tells you whether the particular pin has PWM or not. Try this program.

void setup ()
{
   Serial.begin ( 115200 );
   for ( byte n = 0; n < NUM_DIGITAL_PINS; n ++ )
   {
     Serial.print ( n );
     Serial.print ( "    " );
     Serial.println ( digitalPinHasPWM ( n ) );
   }
}

void loop ()
{
   ;
}

Thanks. Only pins 2-13 has pwm. But why does it say on pins 22-53 that they support PWM?

Who ?

Check out an Arduino Due pinout diagram. The ATSAM3X8E MCU has far more than 12 pins supporting PWM operation. Actually, just the dedicated PWM controller has 8 channels each having 2 outputs for a total 16 PWM pins. Then, there are numerous timer outputs which also support PWM operation.

If you really want to delve into it, download the datasheet, and compare it to a pinout diagram, then match the MCU pins to Arduino pins. Fair warning though; the datasheet is almost 1500 pages long, and pin functions aren't listed pin 1 to pin 144. (Yes, the MCU has 144 pins total, it's a QFP144 package.) Oh, and also, there are two pairs of pins that are tied together on the board. Check my post history if you want to explore that rabbit hole.

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