这个程序AD只触发一次,而且跳不出while循环。@zhangmangui
for(;;)
{
Record=1;
while(Record)
{
DELAY_US(0.5L);
}
}
}
interrupt void aq (void)
{
addat[0] = *AD_ASTART; // UACA1交流侧电压Uab
addat[1] = *(AD_ASTART); // UACA2交流侧电压Ubc
addat[2] = *(AD_ASTART); // INV_Uab
addat[3] = *(AD_ASTART); // INV_Ubc
addat[4] = *(AD_ASTART); // VDC+
addat[5] = *(AD_ASTART); // VDC-
addat[6] = *(AD_ASTART); // Ia
addat[7] = *(AD_ASTART); // Ib
DELAY_US(1L);
addat[8] = *AD_BSTART; // Ic
addat[9] = *AD_BSTART; // Idc1
addat[10] = *AD_BSTART; // Idc2
addat[11] = *AD_BSTART; // Amux
addat[12] = *AD_BSTART; //
addat[13] = *AD_BSTART; //
addat[14] = *AD_BSTART; //
addat[15] = *AD_BSTART; //
if(Record)
{
a[count]=addat[0];
b[count]=addat[1];
c[count]=addat[2];
d[count]=addat[3];
count++;
if(count>=200)
{
count=0;
Record=0;
}
}
//----------------------------------每次运行----------------------------------
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
EINT;
}
interrupt void ISRTimer0(void)
{
GpioDataRegs.GPASET.bit.GPIO15 = 1;// convst
DELAY_US(0.5L);
GpioDataRegs.GPACLEAR.bit.GPIO15 = 1;
GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;//reset off
DELAY_US(0.5L);
GpioDataRegs.GPBSET.bit.GPIO60 = 1;//reset on
DELAY_US(0.5L);
GpioDataRegs.GPASET.bit.GPIO15 = 1;//convst
DELAY_US(5L);
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
CpuTimer1.InterruptCount++;
CpuTimer1Regs.TCR.bit.TIF=1;
CpuTimer1Regs.TCR.bit.TRB=1;
}
|