Page 1 of 1
PWM frequency
Posted: Wed Jun 16, 2021 1:03 pm
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.
Re: PWM frequency
Posted: Wed Jun 16, 2021 1:58 pm
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.