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.

TM4C1294 PWM

Other Parts Discussed in Thread: EK-TM4C1294XL

I've been working with the TM4C1294 for some time now (using TivaWare of course).

I need to generate a 10 MHz 50% duty square wave from pin 1 of port G (pin 0 of port G is being used as an output). There does not seem to be a great deal of information available in this area.

Can anyone point me in the right direction? Thank you for any assistance.

  • Hello Byron,

    Have you had a chance to download TivaWare 2.2.0? We have added multiple new PWM examples for the EK-TM4C1294XL. They have a lot of comments now to explain the setup whereas the prior versions of TivaWare offered files that were centered on TM4C123x devices.

    • pwm_dead_band
    • pwm_interrupt
    • pwm_invert

    For Port G, Pin 1 you would use Motion Control Module 0 PWM 5 which is controlled by the Module 0 PWM Generator 2.

    Best Regards,

    Ralph Jacobi

  • Sorry I was tackling other projects this morning. Thank you for the kind assistance.

    I tried implementing bits of the pwm_interrupt code. The unit enters a FaultISR at the line:

    MAP_PWMClockSet(PWM0_BASE, PWM_SYSCLK_DIV_8);

  • Hello Byron,

    If you are hitting FaultISR on the first PWM peripheral function call then I suspect you didn't add this line of code before the PWM calls:

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);

    Best Regards,

    Ralph Jacobi

  • Correct you are. I had missed the line Disappointed.

    The code compiles and runs: I was hoping for a free-running oscillator but I do not see any result at pin 29 of my LaunchPad. I've likely missed some setting in the configuration. I'll study a bit more and see what I can find...

    Thanks

    Byron

  • Actually Ralph - I restored my attempt from yesterday and added the line I'd missed below. I have a VCO running now. Thank you lad!

  • Hi Byron,

    The code from the TivaWare example would be for Module 0 PWM 2 and Pin 70 of the LaunchPad. You'd need to rework some parts of it to use Module 0, PWM 5 as you desire. One big one is to make sure you are using PWM_GEN_2 and not PWM_GEN_1. 

    • PWM_GEN_0 handles PWM 0 & 1
    • PWM_GEN_1 handles PWM 2 & 3
    • PWM_GEN_2 handles PWM 4 & 5
    • PWM_GEN_2 handles PWM 6 & 7

    And then you will need to change PWM_OUT_2 to PWM_OUT_5, and configure the correct GPIOs.

    Lastly, if using interrupts, you need to update those to use Gen 2 as well.

    Best Regards,

    Ralph Jacobi