ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | //80mhz
SYSCTL_OSC_MAIN);
SysCtlPWMClockSet(SYSCTL_PWMDIV_8); //10MHZ
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinConfigure(GPIO_PF1_T0CCP1);
GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_1); //PF1
PWMGenConfigure(PWM_BASE, PWM_GEN_0, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
PWMGenPeriodSet(PWM_BASE, PWM_GEN_0, 10000); //1khz
PWMPulseWidthSet(PWM_BASE, PWM_OUT_0, 3000);
PWMOutputState(PWM_BASE, PWM_OUT_0_BIT, true);
PWMGenEnable(PWM_BASE, PWM_GEN_0);
让PF1输出,这个应该做何修改呢??
ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | //80mhz
SYSCTL_OSC_MAIN);
SysCtlPWMClockSet(SYSCTL_PWMDIV_8); //10MHZ
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinConfigure(GPIO_PF1_T0CCP1);
GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_1); //PF1
PWMGenConfigure(PWM_BASE, PWM_GEN_0, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
PWMGenPeriodSet(PWM_BASE, PWM_GEN_0, 10000); //1khz
PWMPulseWidthSet(PWM_BASE, PWM_OUT_0, 3000);
PWMOutputState(PWM_BASE, PWM_OUT_0_BIT, true);
PWMGenEnable(PWM_BASE, PWM_GEN_0);
让PF1输出,这个应该做何修改呢??
举报