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.

tm4c1230h6pm 的PWM

Other Parts Discussed in Thread: TM4C123GH6PM

unresolved symbol FPUEnable, first referenced in ./main.obj CH2_1     C/C++ Problem

 unresolved symbol FPULazyStackingEnable, first referenced in ./main.obj CH2_1    C/C++ Problem

这是什么情况啊 ???   请大神指教!!!

 

 

#include <stdint.h>

 #include <stdbool.h>

#include "inc/hw_memmap.h"

#include "inc/hw_types.h"

#include "driverlib/sysctl.h"

#include "driverlib/rom.h"

#include "driverlib/gpio.h"

#include "driverlib/pwm.h"

#include "driverlib/fpu.h"

#include "driverlib/pin_map.h"

 #include <inc\tm4c123gh6pm.h>

int main (void)

 {  

//使能

FPU   FPUEnable();  

FPULazyStackingEnable();

  //设置系统时钟为50MHz  

SysCtlClockSet(SYSCTL_SYSDIV_4 |SYSCTL_USE_PLL |SYSCTL_OSC_MAIN |SYSCTL_XTAL_16MHZ);

  //使能PWM模块  

ROM_SysCtlPeripheralEnable((SYSCTL_PERIPH_PWM0)||(SYSCTL_PERIPH_PWM1));  

 //使能PWM2和PWM3输出所在GPIO  

ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);  

//配置PH0/PH1为PWM功能  

ROM_GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_0);  

ROM_GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_1);

  // PWM时钟配置:不分频  

ROM_SysCtlPWMClockSet(SYSCTL_PWMDIV_1);  

 //配置PWM发生器1:加减计数  

 ROM_PWMGenConfigure(PWM_BASE,                    

PWM_GEN_0,PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC);   

//设置PWM发生器1的周期  

ROM_PWMGenPeriodSet(PWM_BASE, PWM_GEN_0, 6000);  

//设置PWM2/PWM3输出的脉冲宽度  

ROM_PWMPulseWidthSet(PWM_BASE, PWM_OUT_0, 4200);  

ROM_PWMPulseWidthSet(PWM_BASE, PWM_OUT_1, 1800);  

//使能PWM2和PWM3的输出  

ROM_PWMOutputState(PWM_BASE, (PWM_OUT_0_BIT |                       

PWM_OUT_1_BIT), true);  

 //使能PWM发生器1  

ROM_PWMGenEnable(PWM0_BASE, PWM_GEN_0);

while(1);    {    }

 }

 

 

这个PWM 程序有什么问题啊??