The 16-bit PWM Module in the PIC12F1572 takes cues from the 16-bit Output Compare (OC) Module. There are several FRMs that cover the dsPIC33 OC functions if you want a more elaborate explanation. If your PWM Clock is 4 MHz (Fosc/4 @ 16 MHz), each tick takes 0.000 000 250 seconds; or 0.25 uS. For 125 kHz, you need your Period to last for 32 Clock cycles. Unfortunately, that will be your resolution -- 0 >> 31. You cannot get 16-bit resolution -- or anywhere near that. Even setting Fosc to 32 MHz, yielding an 8 MHz Fosc/4, max resolution is still only 0 >> 63. The fastest PWM frequency with 16-bit resolution will be around 122 Hz (not kHz, just Hz). I had considered using this PIC for a previous project and decided to use a dsPIC33 instead, as I couldn't get a fast enough frequency out of the PIC12F1572.
Bookmarks