DSP2812 PWM波例程
DSP2812 PWM波例程 extern int i; Uint32 ratio[]={ 0x40EB,0x40EB,0x39EB,0x39EB,0x38EB,0x38EB,0x37EB,0x37EB,0x36EB,0x36EB,0x35EB,0x35EB,0x34EB,0x34EB,0x33EB,0x33EB,0x32EB,0x32EB,0x31EB,0x31EB,0x30EB,0x30EB,0x30EB,0x30EB,0x30EB,0x29EB,0x29EB,0x29EB,0x29EB,0x29EB,0x28EB,0x28EB,0x28EB,0x28EB,0x28EB,0x27EB,0x27EB,0x27EB,0x27EB,0x27EB,0x26EB,0x26EB,0x26EB,0x26EB,0x26EB,0x25EB,0x25EB,0x25EB,0x25EB,0x25EB,0x25EB,0x25EB,0x25EB,0x25EB,0x25EB,0x24EB,0x24EB,0x24EB,0x24EB,0x24EB,0x24EB,0x24EB,0x24EB,0x24EB,0x24EB,0x1500,0x1500,0x1500,0x1500,0x1 500,0x1500,0x1500,0x1500,0x1500,0x1500,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x753,0x3000,0x3000,0x3000,0x3000,0x3000,0x38EB,0x38EB,0x38EB,0x38EB,0x38EB,0x39EB,0x39EB,0x38EB,0x38EB,0x40EB}; /**************************************************************************** * *名 称:main() * *功 能:初始化系统和各个外设 * *入口参数:无 * *出口参数:无 * ****************************************************************************/ void main(void) { InitSysCtrl(); //初始化系统函数 DINT; IER = 0x0000; //禁止CPU中断 IFR = 0x0000; //清除CPU中断标志 InitPieCtrl(); //初始化PIE控制寄存器 InitPieVectTable(); //初始化PIE中断向量表 InitGpio(); //初始化Gpio口 InitEv(); //初始化EV // i=0; PieCtrl.PIEIER2.bit.INTx4=1; //使能PIE中断,T1定时器中断位于INT2.4 IER|=M_INT2; EINT; //开全局中断 ERTM; //开实时中断 EvaRegs.T1CON.bit.TENABLE=1; //使能定时器T1计数操作 while(1) { } }
用户评论