Hello,
i try to control a simple servo motor with PWM Signal. The configuration of the PWM Modul is below, but that did not work for me. Maybe someone has experience with the TM4C and the PWM signal and see the mistake. I followed the code on this Side which was also written for the TM4C123GH6PM: https://www.egr.msu.edu/classes/ece480/capstone/fall15/group09/appnotes/JoshuaLambApplicationNote.pdf
The names that i have entered, i found in the datasheet for the UC under PWM, at the Table for the PWM Signals. I can post a picture if that would help.
For this application, i want to use the Pin PF3. The Problem is, that the state of the Pin did not change, so it has always the same potenzial.
Maybe there is a problem with the configuration which i posted below ?
About help, i would be very happy.
void Init_PWM(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);
HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= 0x01;
HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0;
//site 1233 datasheet
GPIOPinConfigure(GPIO_PF3_M1PWM7);
GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_3);
PWMGenConfigure(PWM1_BASE, PWM_GEN_3, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
PWMGenPeriodSet(PWM1_BASE, PWM_GEN_3, 8000000);
//!!!!
PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7, 800000);
PWMGenEnable(PWM1_BASE, PWM_GEN_3);
PWMOutputState(PWM1_BASE, PWM_OUT_7_BIT , true);
}