void main(void)
{
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
InitGpio(); // Skipped for this example
// InitXintf16Gpio(); //zq
InitEPwm1Gpio();
Duty=0.5;
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;// 禁用CPU全局中斷(防止配置過程中被中斷打斷)
InitPieCtrl();// 初始化PIE(外設中斷擴展)控制寄存器
IER = 0x0000;// 清零CPU中斷使能寄存器(禁用所有CPU級中斷)
IFR = 0x0000;// 清零CPU中斷標志寄存器(清除所有未處理的中斷標志)
InitPieVectTable();// 初始化PIE向量表(存儲中斷服務函數地址)
// Step 4. Initialize the Device Peripheral. This function can be
// found in DSP2833x_CpuTimers.c
// InitCpuTimers(); // For this example, only initialize the Cpu Timers
// Configure CPU-Timer 0, 1, and 2 to interrupt every second:
// 150MHz CPU Freq, 1 second Period (in uSeconds)