chipKIT® Development Platform

Inspired by Arduino™

PWM settings

Created Fri, 17 Feb 2012 12:55:23 +0000 by jknickelbein


Fri, 17 Feb 2012 12:55:23 +0000

Is there any need to change the PWM frequency and resolution from the default 490Hz: 8 bit setting?

I like to use a higher PWM frequency (4kHz - 8kHz), especially for small motors, so I made a little hack to have a #define for the frequency and resolution. It helps reduce the motor "singing" at low speeds (duty cycles). I was thinking of adding function to set these which can be called in the setup section. I just want to define the frequency and resultion. I don't know how easy it would be have this set per PWM channel, one for all channels.