This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在10us周期的中断中,对一个50Hz周期的正弦波采样,计算有效值,但是加了下面的采样代码,就有莫名其妙的问题,比如影响通信等;这些代码有问题吗?
interrupt void isr()
{//10US
EPwm6Regs.ETCLR.bit.INT = 1; // Clear INT flag for this timer
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3; // Acknowledge this int to receive more int from group 3
if(bACSamplyFinish == 0)
{//10us
TimCount200us++;
if(TimCount200us >= 20)
{//200us
TimCount200us = 0;
u16AcIbAdc = AdcMirror.ADCRESULT3;
u16AcIcAdc = AdcMirror.ADCRESULT4;
g_u32AcIbAdc[ACSamplyCount] = u16AcIbAdc ;
g_u32AcIbAdc[ACSamplyCount] =u16AcIcAdc ;
ACSamplyCount++;
if(ACSamplyCount >= 100)
{//20ms
bACSamplyFinish = 1;
ACSamplyCount = 0;
}
}
}