Generating Pulse Frequency Modulation

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
lau
Posts: 4
Joined: Tue Sep 25, 2018 3:10 am
Been thanked: 1 time

Generating Pulse Frequency Modulation

Postby lau » Tue Sep 25, 2018 3:23 am

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

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Generating Pulse Frequency Modulation

Postby Giovanni » Tue Sep 25, 2018 12:22 pm

Hi,

You need pwmChangePeriodI().

Giovanni

lau
Posts: 4
Joined: Tue Sep 25, 2018 3:10 am
Been thanked: 1 time

Re: Generating Pulse Frequency Modulation

Postby lau » Wed Sep 26, 2018 12:36 am

Thanks , I must be blind not to see that.... :oops:


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 23 guests