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.

DSP28335 AD查询采样,但是进入ADC SQ1中断中,导致定时器失效

void AD_Sample(ADCSAMPLE *ADC_SmpleData)
{
char *msg;
memset(DMABuf1,0,256);
while(1)
{
//for(array_index=0;array_index<20;array_index++)
//{
while(AdcRegs.ADCST.bit.INT_SEQ1 == 0);
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;

DMABuf1[array_index]=((AdcRegs.ADCRESULT0)>>4);
DMABuf1[10+array_index]=((AdcRegs.ADCRESULT1)>>4);
DMABuf1[20+array_index]=((AdcRegs.ADCRESULT2)>>4);
DMABuf1[30+array_index]=((AdcRegs.ADCRESULT3)>>4);
DMABuf1[40+array_index]=((AdcRegs.ADCRESULT4)>>4);
DMABuf1[50+array_index]=((AdcRegs.ADCRESULT5)>>4);
DMABuf1[60+array_index]=((AdcRegs.ADCRESULT6)>>4);
DMABuf1[70+array_index]=((AdcRegs.ADCRESULT7)>>4);
DMABuf1[80+array_index]=((AdcRegs.ADCRESULT8)>>4);
DMABuf1[90+array_index]=((AdcRegs.ADCRESULT9)>>4);
//DMABuf1[200+array_index]=((AdcRegs.ADCRESULT10)>>4);
//DMABuf1[220+array_index]=((AdcRegs.ADCRESULT11)>>4);
array_index++;
//}
if(array_index>=10)
{
Read_ADC_Result(1,ADC_SmpleData);
array_index=0;
msg="Recorder Read AD Data End \r\n";
scic_msg(msg);
break;
}

进入到中断,导致定时器进入不了中断

nterrupt void SEQ1INT_ISR(void) //SEQ1 ADC
{
char *msg;
// Insert ISR Code here

// To receive more interrupts from this PIE group, acknowledge this interrupt
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code

//asm (" ESTOP0");
//for(;;);
//PieCtrlRegs.PIEACK.all = PIEACK_GROUP7;
//ADSample_End=1;
msg="AD SEQ1\r\n";
scic_msg(msg);

}

  • 你在采样中断中用了while(1),所以一旦进入该中断,则永远也不会出中断,那么cpu中断源得不到释放,其他任何中断都得不到cpu响应。

    需要推出一个中断,另外一个中断才会拿到cpu响应。