1

Arduino Due has 54 pins. It says that it has 12 PWM pins. I know it uses a more powerful chip than other Arduinos.

Can the number of PWM be increased?

Can any of its pin be used for PWM?

  • Any number of its pins can support PWM depending on how much work you're willing to put in. – Ignacio Vazquez-Abrams Oct 18 '17 at 14:55
  • 1
    If you can explain how that would be nice – Programmer Oct 18 '17 at 14:58
  • @Programmer it's a joke, the work needed includes modifying the silicon inside the microcontroller by adding the pwm hardware and adding the registers needed to control them and modifying the compiler to make use of them. – ratchet freak Oct 18 '17 at 15:12
2

According to the manual:

"The Arduino Due supports analogWrite() on pins 2 through 13, plus pins DAC0 and DAC1. Unlike the PWM pins, DAC0 and DAC1 are Digital to Analog converters, and act as true analog outputs."

https://www.arduino.cc/en/Reference/AnalogWrite

1

You could do software pwm but the frequency will be several orders of magnitude less than the clock frequency.

The hardware pwm pins have a counter a register and a comparator where every tick it increments the counter, compares the value of the counter to the value in the register and setting the pin to the corresponding value.

If you need more analogue outputs then it's easier to use an external DAC module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.