4 Replies Latest reply on Mar 20, 2020 12:23 AM by mawu_4270096

# pwm issue

Hi  all:

the pwm calculation:

Initial count = 0xFFFF - (Input Clock Freq / PWM Freq out)

Toggle count = 0xFFFF - ((duty cycle in percentage) * (Input Clock Freq / PWM Freq out) / 100)

so the PWM  resolution is 1/100, I want to know if I can change the PWM resolution to 1/1000

Calculation formula:

Initial count = 0xFFFF - (Input Clock Freq / PWM Freq out)

Toggle count = 0xFFFF - ((duty cycle in thousandth) * (Input Clock Freq / PWM Freq out) / 1000)

thanks!

mandy

• ###### 1. Re: pwm issue

Could you explain the background of the questions you described?

From the description, we don't understand what do you want to do and what issue you meet?

Or could you tell us the formula where you get?

• ###### 2. Re: pwm issue

Hi LinglingG_46:

the application background is to control the dimmable light brightness, we can control the PWM pulse width to change the brightness,  each time the PWM pulse width changes too much, it will cause the lamp to flicker !

the Calculation formula is supported by RanjithK_41

Initial count = 0xFFFF - (Input Clock Freq / PWM Freq out)

Toggle count = 0xFFFF - ((duty cycle in percentage) * (Input Clock Freq / PWM Freq out) / 100

the website is below:

I want to know if I can change the duty cycle from percentage  to thousandth, if it is possible, it will

Improve the accuracy of PWM duty cycle

thanks!

mandy

• ###### 3. Re: pwm issue

Do you check if the PWM accuracy is the root cause? I am not sure if 1% change of the PWM output will cause a flicker.

As we tested before, when you set the PWM output to 100% or 0%, the output may be wrong. Could you check if that is the problem?

1 of 1 people found this helpful
• ###### 4. Re: pwm issue

Hi：

I am sure that the PWM accuracy is the root cause, now I have enhanced the PWM accuracy, the flicker question has been resolved

thanks!

mandy