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: PWM Module

Part Number: TM4C123GH6PM

Hello,

I had a quick question about the PWM Modules. How would I know when I have to choose GenA or GenB in Generator#? Is it based on the output port# I will using? 

Example, I want to use PORTA6.

Would I use Module1, PWMGenerator1, GenA?

 

Or let's say, PORTE5.

Module0, PWMGenerator2, GenB?

  • Hi,

      Please refer to the datasheet PWM signal list and PWM Module Diagram. As you can see for PA6, you would be using PWM Module 1 and Generation 1 so that PWM2 signal is output on PA6 pin.

  • Seeing this diagram, is it possible to use either A or B generator with either generator#? or as they specially assigned by the port output?

    Also i have seen a spike in the output when Load register equals the Compare register. Is there something i should do to keep that from happening?

    i.e.

    Load = 16000

    Cmpa= 15999

  • is it possible to use either A or B generator with either generator#? or as they specially assigned by the port output?

    I'm not clear with what you mean. You can use PWM generator 1 to control pwm2 and pwm3 outputs. What are the A or B you are referring? There is no A or B generator on the diagram. Don't get confused with the A or B comparators. 

    i.e.

    Load = 16000

    Cmpa= 15999

    Your load value and compare value is only one cycle off and you are will get a pulse. Let's say the PWM output is high when the load value is 16000. Depending on what your chosen action to take (e.g. drive low when a compare match), when the counter counts down to 15999 which is only one cycle, the PWM output will change to low. This is why you see you see a tiny pulse.