This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: Variable frequency PWM Generation

Part Number: TM4C123GH6PM

Hello,

Could it be possible to generate pwm such that as the duty cycle increases, the frequency increases as well?

What would be the strategies for achieving a variable frequency pwm driver?

a. can we set PWMGenPeriodSet dynamically, each time we set a pwm duty cycle?

b. how can we use different PWM generators running at different frequencies, and generate a PWM signal from the same pin, depending on the duty cycle generator with low or high frequency is used.

Best Regards,

Can

  • Hi Can,

    a. can we set PWMGenPeriodSet dynamically, each time we set a pwm duty cycle?

      What type of application would require you to change both the period and duty cycle? Normally, you would only change the duty cycle. But if your application needs to change the period dynamically you can still do so. Please refer to the datasheet. 

    b. how can we use different PWM generators running at different frequencies, and generate a PWM signal from the same pin, depending on the duty cycle generator with low or high frequency is used.

     I don't think it is possible to use different generators on the same pin. Each PWM generator only has one counter but associates with two pins using two different comparators - in another word two match values. You can use generator 2 (only associated with PWM4/5 pins) to produce a PWM on a pin (PWM0/1) that is associated with generator 0 only. 

  • thank you Ralph, yes we can actually change period on the fly, but I think I need to ask a more basic question about my setup, in a different thread due to my use of PB6 and PB7.

    Best Regards,

    Can