#include "inc/DSP28_Device.h"
void init_eva(void)
{
EvaRegs.T1PR=0xffff;周期寄存器
EvaRegs.T1CMPR=0x1fff;比较寄存器
EvaRegs.T1CON.all=0x1042;
EvaRegs.GPTCONA.bit.T1PIN=2;设置为高有效
EvaRegs.GPTCONA.bit.TCOMPOE=1;
EvaRegs.COMCONA.all=0xa600;
EvaRegs.DBTCONA.all=0x0000;死区设置为零
EvaRegs.CMPR1=0x2fff;
EvaRegs.CMPR2=0x4fff;
EvaRegs.CMPR3=0x6fff;
EvaRegs.ACTR.all=0x0666;
}
void main(void)
{
InitSysCtrl();
DINT;
InitPieCtrl();
InitPieVectTable();
init_eva();
EALLOW;
GpioMuxRegs.GPAMUX.all=0x00ff;设定a口的pwm功能
EDIS;
while(1);
}
EVA1.rar
(83.32 KB)
|