[sdiy] dsPIC PWM

Tom Wiltshire tom at electricdruid.net
Fri Jul 1 21:17:39 CEST 2016

On 1 Jul 2016, at 16:04, rburnett at richieburnett.co.uk wrote:

>> On the subject of PWM, does anyone know how the "High-speed PWM" in
>> Microchip's Motor Control dsPICs actually works?
> Actually just found this explanation...
> http://www.microchip.com/forums/m379794.aspx
> It looks like the clock frequency is indeed multiplied up to a very high rate (480 MHz) and both the rising and falling edges are used for the PWM clock, giving an effective PWM clock rate of 960MHz (0.96GHz,) or 1.04ns resolution!
> Might be useful for DCO-type oscillator applications like this:
> http://electricdruid.net/roland-juno-dcos/
> It will be a lot easier to hit those high-pitched notes exactly when dividing down from such a high master clock frequency.  I gather that some of the Motor Control dsPICs can also have independent period values set for the different PWM output pins too, so they might make a good modern replacement for the humble 8253 Programmable Interval Timer!
> -Richie

I did some investigation into this when the Prophet 08 came out (it uses a 33FJ128MCxxx processor). On that chip you can't set different timebases for the PWM channels, but the chip has four 32-bit timers that can be clocked at 40MHz. On the assumption that those were used for generating the DCO timing(reset) pulses, I worked out that the frequency error for even the highest MIDI notes is always below 0.2 of a cent. For most of the range, it's an order of magnitude better than that.

The high speed PWM might offer an improvement, but you won't actually notice!


More information about the Synth-diy mailing list