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?