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?
Clarification about matrix PWM example
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Clarification about matrix PWM example
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 91
- Joined: Fri Oct 27, 2017 9:50 am
- Has thanked: 13 times
- Been thanked: 10 times
- Contact:
Re: Clarification about matrix PWM example
Thank you very much Ben.
I've tried it with a microcontroller and it's good.
F.
I've tried it with a microcontroller and it's good.
F.