This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PWM Resolution

Hi there , 

Anyone who can explain the relation between the pwm frequency and its resolution ? If our PWM frequency increases how does its resolution changes ? The microcontroller I'll use has no info about how man pwm channels does it has infact it mentions about NHET's which I found out its a new generation and its pins can be programed as a pwm. Would be glad to get some more info about this NHET thing. It has a conversion equation explaining the NHET PWM relation but feels like I'm not fully satisfied. As for the first question. Consider that I'll work in very high frequency range.

 thx ,

Fatih  

  • Fatih,

    I guess that you already read the NHET spec and are aware of the terminology of "LRP" (loop resolution period) and "HR" (high resolution). You can easily change the period of a PWM in the resolution of one LRP. The high/low time of a PWM can be changed in the resolution of of one HR clock. Let me illustrate this by an example.

    Assume the following clocks in your system: HCLK(system clock) = 200 MHz, VCLK (peripheral clock) = HCLK/2=100MHz. Also assume that you need a complex timer operation and need to run up to 64 NHET instructions in one LRP., Since NHET runs from VCLK,  LRP= 64xVCLK = 640ns, HR = VCLK=10ns. In this example, The period can be adjusted in the resolution of 640ns, and high/low time can be adjusted in a resolution of 10ns.  If you only need to run 16 NHET instructions, you can adjust the period in a resolution of 160ns.

    There are methods to adjust the period with HR resolution. But it is quite involved and you must calculate each edge in NHET microcode. Debugging will not be easy.

    Please let me know if this answers your question.

    Thanks and regards,

    Zhaohong