Page 1 of 1

Generating Pulse Frequency Modulation

Posted: Tue Sep 25, 2018 3:23 am
by lau
hi all .

I am having dilemma over generating a PFM ( Pulse Frequency Modulation ) in which i will need to modified the "off" time of the pulse on the fly. The "On" time of the pulse will be change but less frequently . By changing the "off" time , effectively we are changing the frequency hence achieving PFM.

The problem comes when looking for the right Hal driver , the closest that I could find is hal_PWM , but it only allow me to manipulate the pulse duty cycle on the fly but not the frequency. There is a GPT_driver, they do seem able to run and change frequency on the fly , but i need more dedicated control over the off / on time.

Is there a better way to do it ?

Kindly advice .

Best Regards
lau

Re: Generating Pulse Frequency Modulation

Posted: Tue Sep 25, 2018 12:22 pm
by Giovanni
Hi,

You need pwmChangePeriodI().

Giovanni

Re: Generating Pulse Frequency Modulation

Posted: Wed Sep 26, 2018 12:36 am
by lau
Thanks , I must be blind not to see that.... :oops: