/*
有问题可咨询
HRX
6路外部中断、3路PWM
pwm1下层两路 对应外部中断3 4(奇数是靠近电机 偶数是远离电机)
PWM2Z轴 对应外部中断1 2
PWM3中间轴 对应外部中断5 6
*/
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
interrupt void ISRExint1(void); // ExInt1
interrupt void ISRExint2(void); // ExInt2
interrupt void ISRExint3(void); // ExInt3
interrupt void ISRExint4(void); // ExInt4
interrupt void ISRExint5(void); // ExInt5
interrupt void ISRExint6(void); // ExInt6
Uint16 *ExRamStart = (Uint16 *)0x100000;
void EPwmSetup();
int flag;
Uint16 i;
void configtestled(void);
void main(void)
{
InitXintf16Gpio(); //zq
// InitScibGpio();
IER = 0x0000;
IFR = 0x0000;
InitPieCtrl();
InitPieVectTable();
// Disable CPU interrupts and clear all CPU interrupt flags:
InitSysCtrl();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
InitExInt();
EALLOW;
PieVectTable.XINT1 = &ISRExint1;
PieVectTable.XINT2 = &ISRExint2;
PieVectTable.XINT3 = &ISRExint3;
PieVectTable.XINT4 = &ISRExint4;
PieVectTable.XINT5 = &ISRExint5;
PieVectTable.XINT6 = &ISRExint6;
EDIS;
PieCtrlRegs.PIEIER1.bit.INTx4= 1; //ExInt1
PieCtrlRegs.PIEIER1.bit.INTx5= 1; //ExInt2
PieCtrlRegs.PIEIER12.bit.INTx1= 1; //ExInt3
PieCtrlRegs.PIEIER12.bit.INTx2= 1; //ExInt4
PieCtrlRegs.PIEIER12.bit.INTx3= 1; //ExInt5
PieCtrlRegs.PIEIER12.bit.INTx4= 1; //ExInt6
1