AnsweredAssumed Answered

How can I control PWM at a specified frequency?

Question asked by Toshiyuki Takagi on Dec 2, 2019
Latest reply on Dec 4, 2019 by Jing Pan

Hello,

 

I am studying how to use FlexIO PWM in the SDK sample project "flexio_pwm".
I am using "TWR-KE18F" board.
When I tried to run, it was not working according to the specified frequency. (See the figure below.)

 

                                                                                                   ↑Frequency specified in        ↑Actual frequency measured    
                                                                                                     code (flexio_pwm.c)              with Memory high coder.

 

I imagined that the frequency specified in the code would be the PWM control frequency.    
    DEMO_FLEXIO_FREQUENCY == PWM actual frequency
However, the actual frequency was not same.    
    100 Hz ≠ 800 Hz

 

Why are the frequencies not matching?
How can I control PWM at a specified frequency?

 

Best regards.

Outcomes