This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I want to control the frequency of PWM accurately.

Hello

I'm testing multiple frequencies to ensure smooth ultrasound control.

Frequency can be generated via 'APP_PWM_DEFAULT_CONFIG_1CH (period, pin)'.  But it seems difficult to use this to output more accurate frequencies.

For example, if I use that function to put 10 in the period value, 100 kHz is output, and if I put 9 in, 111 kHz is output. What should I do to print the value between them here?
I need detailed frequency output.

Thank you.

Parents Reply Children
  • schosdas said:
    Thank you for your answer.

    No problem at all, I am happy to help! 

    schosdas said:
    I succeeded in outputting the frequency through Prescaler and top_value of pwm_driver.

    I am glad to hear that you were able to achieve the desired frequency by my suggestion using the PWM driver :) 

    Please do not hesitate to open a new ticket if you should encounter any other issues or questions.

    Good luck with your development!

    Best regards,
    Karl 

Related