Hi,

Yes, "speed" isn't a very good term to use and IMHO the description isn't very clear. The calculation can be done either with "frequency" or "period" values and here frequency is probably easiest:

First, simply divide the clock frequency by the required PWM frequency, i.e. 32,000,000 by 14,000 = 2285.7 cycles

But the maximum PWM count is 1023 so we need to use the "prescaler" to divide by 4 with **PWMDIV4** in this example to give 571

Next, the PIC PWM instruction fits the period counter into a single byte (max 255) and also starts coding the value from zero, so we need to divide by 4 (again) and then subtract 1. This gives 142.8 - 1 = 141 , but in this case it would probably be better to round up to 142 .

Thus the PWM period would have 143 * 4 = 572 cycles and 70% becomes 400.4 . Again, normally you would subtract 1 to code as 399, but the Wizard appears to give 400 .

Cheers, Alan.