Other Parts Discussed in Thread: EK-TM4C1294XL
Hi,
I have tried several way and checked the examples but could not make the code below work. I have a fan plugged to my output but could not make it work with PWM, also the fan LED does not even light up. Thanks for help.
{code}
SysCtlClockSet(
SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
SysCtlPWMClockSet( SYSCTL_PWMDIV_64);
SysCtlPeripheralEnable( SYSCTL_PERIPH_PWM0);
SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOD);
GPIOPinConfigure( GPIO_PD0_T0CCP0);
GPIOPinTypePWM(GPIO_PORTD_BASE, GPIO_PD0_T0CCP0);
PWMGenConfigure( PWM1_BASE, PWM_GEN_0, PWM_GEN_MODE_DOWN);
PWMGenPeriodSet( PWM1_BASE, PWM_GEN_0, 2500);
PWMPulseWidthSet( PWM1_BASE, PWM_OUT_0,
(PWMGenPeriodGet(PWM1_BASE, PWM_GEN_0) / 2));
PWMOutputState( PWM1_BASE, PWM_OUT_0_BIT, true);
PWMGenEnable( PWM1_BASE, PWM_GEN_0);
while (1)
{
;
}
{code}