Page 1 of 1
Clarification about matrix PWM example
Posted: Tue Apr 02, 2019 11:11 am
by Fer_taca
I have taken the example of PWM, I have changed some parameters on it and in the panel I visualize how the pulse width varies. I have placed a led to the output pin, but I see no change in it.
Could it be that the frequency is very high?
Re: Clarification about matrix PWM example
Posted: Tue Apr 02, 2019 12:51 pm
by Benj
Hello,
PWM duties of over 50% will probably not increase the brightness of the LED much but under 50% should be visible.
As your PWM period is 49, duties up to 50% include the values 0-25 which will take approx 0.5s at 20ms per value.
It might be worth having a decision which sets the duty back to 0 if over 49 to avoid waiting at 100% for the duty variable to rollover e.g. 49 to 256.
20KHz is fast but should be ok, you certainly won't get any flicker. Anything over 60Hz is usually pretty good. Over 120 Hz and you should be fine. I've had to go to really high frequencies e.g. 20KHz on things like my POV display where the LED is physically moving at speed.
Please note the simulation LED will not be able to simulate the output brightness, it's just too much to process on the fly, you will have to use a real LED and microcontroller.
Re: Clarification about matrix PWM example
Posted: Tue Apr 02, 2019 4:13 pm
by Fer_taca
Thank you very much Ben.
I've tried it with a microcontroller and it's good.
F.