PWM frequency

For general Flowcode discussion that does not belong in the other sections.
Post Reply
kramtlas
Posts: 13
http://meble-kuchenne.info.pl
Joined: Mon Dec 14, 2020 7:22 am
Has thanked: 1 time

PWM frequency

Post by kramtlas »

I am trying to set the frequency of a PWM signal to 100Hz and the closest I can manage is 122Hz. Do you have any examples to demonstrate how I might be able to achieve this? I have attached a screenshot for reference.
Attachments
2021-06-16_12h50_49.jpg
2021-06-16_12h50_49.jpg (72.33 KiB) Viewed 1409 times

BenR
Matrix Staff
Posts: 1777
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 454 times
Been thanked: 614 times

Re: PWM frequency

Post by BenR »

Hello,

If you change the required frequency e.g. from 100 to 150 and then back to 100 it will force the calculations to be reset and this will get you as close aspossible to 100Hz at the current clock speed.

100Hz is fairly low frequncy for PWM and so you may have to drop your clock frequency to acheive this. The clock frequency is set in the project options. If you are using the internal oscillator then the Runtime -> Matrix Tools -> IntOsc helper component will help guide you to which clock rates are possible and how to configure the chip to those rates.

Post Reply