App note: High-Precision 16-Bit PWM


Technical brief from Microchip on their high-precision 16-Bit PWM modules found on various PIC16 devices. PDF link here

The high-precision 16-bit PWM available in various PIC16 devices such as the PIC16F1574, delivers advanced features beyond those found on standard PWM modules. These innovative features allow the user to easily vary phase, duty cycle and offset event count with greater precision. Via the offset modes, each PWM output can offset its waveform relative to any other PWM module on the same device. The high-precision 16-bit PWM is ideal for power supplies, LED lighting, color mixing, and motor control applications. In addition, when not using the PWM outputs the module can be used to add up to four additional general purpose 16-bit timers.

Join the Conversation


  1. Leading sentence is a bit optimistic…
    So far only one or two families in the PIC16 Enhanced Mid Range has 16-bit PWM. I checked my pile of PIC16 EMR datasheets, over 3/4 of the datasheets use CCP/ECCP or some special motor or power control PWM peripheral. Then a look at Microchip tables show two families with 16-bit PWM: PIC16F157* and PIC16F178*

    1. The PIC12F1572 does 16bit PWM, it’s one of the cheapest PIC microcontrollers in DIP too. I have a DIP-8 version of it and have used it for a DC/DC converter.

    2. Though I understand that’s a PIC12F not PIC16F, but there is also the PIC16F176* with 16bit PWM

  2. dsPic33EpxxxGSxxx have brutal Switcher power control, 1ns resolution PWM, with high speed comparators, high speed ADC, DAC, etc etc.. all interconnected. an they come in 28 soic packages :D

  3. Anyone know how center aligned pwm is implemented at the low level compared to edge aligned pwm? I know it’s a bit is either set or unset depending on which you want, but what is going on under the hood between these 2 schemes?

  4. “High precision”? Maybe TI Piccolo is high precision PWM (180ps resolution). What’s so special about 16-bit PWM?

    1. They are optimized for different application and price points. Us hobbyists may not really care and will choose differently compared to a manufacturer planning a large production run.
      For example the dsPic33EP parts Filip mentioned has 1ns resolution, and it has everything to build say a 2-phase high-performance buck power supply. The DACs are 12-bit (much better than 8-bit or 5-bit DAC PIC16 peripherals) and integrated with the comparator already, IIRC you can’t use it separately! Same with TI Piccolo, it’s designed to be optimal for certain applications. Modern manufacturing is so highly optimized that often you need to pick the correct parts for the product, not just any random MCU.
      For this 16-bit PWM, the new PIC16 parts are cheaper than dsPic33EP and TI Piccolo (as far as what I can see on Farnell). Not only that, you can get QFN parts with low pin counts, saving board size and cost, for say, premium RGB lighting applications like the Philips stuff.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.