Clarification about matrix PWM example

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Fer_taca
Posts: 91
Joined: Fri Oct 27, 2017 9:50 am
Has thanked: 13 times
Been thanked: 10 times
Contact:

Clarification about matrix PWM example

Post 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?
Attachments
PWMDemo1.fcfx
(9.31 KiB) Downloaded 151 times

User avatar
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

Post 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.

Fer_taca
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

Post by Fer_taca »

Thank you very much Ben.
I've tried it with a microcontroller and it's good.


F.

Post Reply