Go Down

Topic: Default PWM frequency of MKR 1000 (Read 1 time) previous topic - next topic

MEL69

Hello,

I cannot find any information on the default frequency of MKR 1000 on the PWM pins.

Can someone point me to a document?

Thanks
Markus

PaulS

The art of getting good answers lies in asking good questions.

MEL69

Thanks for the link - unfortunately I was not able to find anything about PWM frequency.

MartinL

#3
Aug 24, 2017, 10:13 am Last Edit: Aug 24, 2017, 10:15 am by MartinL
Hello MEL69,

The default PWM frequency for the MKR1000 is 187.5kHz with 8-bit resolution.

However with register manuipulation, the MKR1000's ATSAMW25 (which contains a SAMD21 microcontroller) provides much more flexibility, as its possible to change the frequency and increase resolution.

PWM with register manipulation is discussed on the Arduino Zero forum: https://forum.arduino.cc/index.php?topic=346731.0. The Zero uses the same SAMD21G microcontroller as the MKR1000.


MEL69

Thank you. That is really high - it also explains why my power mosfets are getting so hot.

MartinL

As of build 1.6.16 the analogWrite() function has been changed to allow for 16-bit resolution.

It also now operates at a lower frequency of 732Hz.

MEL69

Great, thanks for the update. I found a solution already but might switch to the new version. I would be ideal if they would make the frequency variable.

MEL69

Strange, I checked my IDE and I use version 1.8.2 but it makes the MKR1000 do PWM at 187.5kHz

newhobby

It's 1.6.16 of the core libraries and not the IDE version.
Go to boards manager and download the latest for MKR1000.
I'm glad I found this too as I recall experimenting on MKR1000 before way back and it was KHz range and all of a sudden I started getting in the sub KHz today.

Go Up