PWM Pins don't work

Hi All,

I am new to Arduino as well as I'm new to electronics, but I was always interested.
I have bought Arduino Due and I'm trying some simple projects, but I found a problem. PWM pins 2-7 do not work. I tried to make them blink led but it didn't work. Is there anything special about those pins that need to be setup or should it work with no modification?
All other PWM pins work OK. Does that mean my pins are broken?

Thank you for any helpful comments.

Mirek

Hi Mark,

Could you show us the siimplest sketch that doesn't work please?

Jim

I tried this on all other PWM pins and it worked. Pin here is set to 13 but I changed that to all PWM pins.

int ledPin = 13;
void setup() {
  pinMode(ledPin, OUTPUT);
}
void loop() {
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}

Hi Mirek,

Sorry, misread your name...

With the test sketch below, I get the expected outputs on a scope on pins 3 to 13 continuously, but strangely intermittent activity on pin 2 - I'll investigate further when I have time.

Jim

#include "Print.h"

int count = 1;
int ledPin = 13; // LED connected to digital pin 13

// Run once, when the sketch starts.
void setup()
{
Serial.begin(115200);
Serial.println("Blink");
count = 0;

// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}

void loop()
{
// Write to PWM pins.
for (int pin = 2; pin <= 13; pin++)
{
analogWrite(pin, 255);
delay(1);
analogWrite(pin, 0);
delay(1);
}

delay(100);

count++;
}