Confusion on number of PWM pins

I just got the Nano 33 BLE, but I'm confused on the number of PWM pins. On the pinout, all digital pins have a ~, which I thought stands for PWM-capable. On the box, it says there are 6 PWM pins. In the Tech Specs on the Arduino Docs site (here), it says there are 5 PWM pins. So which is it? I'm designing a custom PCB for my project around this board, and I need PWM, so it's important to know which ones I can use since I won't be able to change it after fabrication. Thankfully, I only need 5 PWM outputs, so I should be fine either way.

I will probably go ahead and do some testing to find out, but it would still be nice to get some clarification on the documentation.

just what you need: more confusion

it says every digital pin can be use for PWM, it says there are 14, it shows 12

Alright, it looks like the pinout is correct after all. I tried pins D2 - D13 with a little test program, and they were all able to drive a servo correctly. They should really update the documentation to avoid confusion.

Thankfully my micro servo can run on 3.3V, since apparently the 5V pin doesn't actually provide output voltage on this board. It would have been a lot more annoying to test otherwise.

A servo does not use pwm, but rather a different timer based pulse of between 1 and 2 millisecond width in a 20 millisecond frame.

That said, it is my experience with the Nano 33 BLE is that there is pwm output on all the digital pins and you can use either analogWrite() or mbed syntax.

1 Like

A servo does not use pwm, but rather a different timer based pulse of between 1 and 2 millisecond width in a 20 millisecond frame.

Isn't that pwm? The signal is encoded in the width of the pulse after all. There seems to be some disagreement on this point: thread.

In the end it doesn't really matter to me, since I know I can do what I need with any of the digital pins. There is still the matter of confusion in the documentation that might trip up someone else, though.

the 5v pin passes power from the usb connection. if you are not using usb to power your micro then no there will not be power there.

I see upon looking more carefully at the datasheet that that is supposed to be the case; however, it's not working on mine. I had it hooked up to USB, when attempting to draw power from the 5V pin, the servo didn't even twitch. Then I checked with a voltmeter, and readings were in the noise.

PS How do I quote on here including the name of the author and a hyperlink? I don't see a button.

That's strange, I wonder why.

Just highlight any portion( or all) of a post. when you release a pop up will give the option to quote

1 Like

From the schematic of the Nano33 BLE, there is a solder pad that needs to be bridged to get the USB 5V on the 5V pin.

image

1 Like

Thanks for the tip! I see those pads but didn't realize they needed to be soldered together to get the 5V on the pin. Makes sense though.

Edit: I checked and do indeed get 5V out of the pin when connected to USB after bridging the pads.

The real point is that a servo doesn't need analogWrite() so can work on any pin even if it doesn't have a ~.

On an Uno for example, where there are (if my memory serves me) 6 ~ pins, a servo runs on any of the digital pins as well as on the analog input Ax pins which are digital pins anyway.

edit:

Whatever name/s we give to the principle,

  • analogWrite() provides a wave with a particular proportion of high time to low low, while
  • servo.write() or servo.writeMicroseconds() provides a wave with an absolute high time.
1 Like

Gotcha. Thanks for correcting my misconception about servos and PWM. I will mark post #4 as the solution then, which confirms that actual PWM is available on all the digital pins.

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