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.

TM4C1230D5PM: TM4C1230D5PM PWM

Part Number: TM4C1230D5PM
Other Parts Discussed in Thread: TM4C123GH6PM

Hi,

I have been developing a system around the TM4C123G LaunchPad, I have now developed a PCBA which uses the TM4C1230D5PM and I am struggling getting the existing code working which drives a PWM output. The same code runs on the launchpad.

This is the code to setup the PWM output.


   //Configure PWM Clock divide system clock by 64
   SysCtlPWMClockSet(SYSCTL_PWMDIV_64);

   // Enable the peripherals used by this program.
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);

    //Configure PF3 Pins as PWM
    GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_3);

    //Configure PWM Options
    PWMGenConfigure(PWM1_BASE, PWM_GEN_3, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);

    //Set the Period (expressed in clock ticks)
    PWMGenPeriodSet(PWM1_BASE, PWM_GEN_3, period);

    //Set PWM duty
    PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7,50);

    // Enable the PWM generator
    PWMGenEnable(PWM1_BASE, PWM_GEN_3);

    // Turn on the Output pins
    PWMOutputState(PWM1_BASE, PWM_OUT_7_BIT,true);
    PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7,0);

}

The code fails when this line is executed

PWMGenConfigure(PWM1_BASE, PWM_GEN_3, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);

When I examine the line that fails I notice that the register address of PWM 1 is 0x40029000.

From the TM4C1230D5PM datasheet this address is reserved and I dont see an address for either PWM 0 or 1 and the address which is used in the TM4C123GH6PM is reserved.

What do I need to do to drive the PWM output?

  • Hello Craig,

    The TM4C1230D5PM does not have PWM modules.

    This can be seen in the datasheet by observing Register 37: Pulse Width Modulator Peripheral Present and additionally our product selector package accurately indicates the MCU you chose has no PWM module.

    The address of 0x4002.9000 does appear within the TM4C123GH6PM datasheet specifically for PWM 1.

    Also, it doesn't look like your images uploaded correctly on the forum, if they are needed to provide added information then please try and re-upload them.

    You could try and use the timer modules for PWM purposes. See Section 10.3.2.5 of the datasheet titled PWM Mode under General Purpose Timers for details on that.