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.

TMS320F28377D: ADC ISR ADCA1_INT Cannot be Triggered after 28543 cycle

Part Number: TMS320F28377D

Hi expert,

This problem probably happened 1 time of 500 times startup.  there is only this one interrupts in my project.

Setup are as following:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
acqps = 28; //75ns
EALLOW;
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 1; //SOC0 will convert on channel 1
AdcaRegs.ADCSOC1CTL.bit.CHSEL = 4; //SOC1 will convert on channel 4
AdcaRegs.ADCSOC2CTL.bit.CHSEL = 3; //SOC2 will convert on channel 3
AdcaRegs.ADCSOC3CTL.bit.CHSEL = 2; //SOC3 will convert on channel 2
AdcaRegs.ADCSOC4CTL.bit.CHSEL = 5; //SOC4 will convert on channel 5
AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps; //sample is acqps + 1 SYSCLK cycles
AdcaRegs.ADCSOC1CTL.bit.ACQPS = acqps; //sample is acqps + 1 SYSCLK cycles
AdcaRegs.ADCSOC2CTL.bit.ACQPS = acqps; //sample is acqps + 1 SYSCLK cycles
AdcaRegs.ADCSOC3CTL.bit.ACQPS = acqps; //sample is acqps + 1 SYSCLK cycles
AdcaRegs.ADCSOC4CTL.bit.ACQPS = acqps; //sample is acqps + 1 SYSCLK cycles
AdcaRegs.ADCSOC5CTL.bit.ACQPS = acqps; //sample is acqps + 1 SYSCLK cycles
AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; //enable INT1 flag
AdcaRegs.ADCINTSEL1N2.bit.INT2E = 1; //enable INT2 flag
AdcaRegs.ADCINTSEL3N4.bit.INT3E = 0; //disable INT3 flag
AdcaRegs.ADCINTSEL3N4.bit.INT4E = 0; //disable INT4 flag
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ADC_ISR Code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
interrupt void Control_isr(void)
{
nCnt_INT_Idts++;
// Read ADC Results
...
// End reading
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //clear INT1 flag
PieCtrlRegs.PIEACK.bit.ACK1 = 1; //Acknowledge group 1 interrupt
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there any problem?

  • Can you clear the INT at the beginning of the ISR vs at the end?  My only concern is if the ISR is quite long, you could get another ADC ISR before the flag is cleared, which would result in missing the new ISR/flag getting set.  I don;t think this would hang, since the next ISR should happen after the flag is cleared, but that could explain missing an ISR.

    Best,
    Matthew

  • Hi Matthew,

    The ADC ISR will not be triggered in my case, not missing an ISR. And main loop is working normally.

    BR/Alvin

  • Alvin,

    To clarify, when the issue happens you don't get any ADC ISRs at all from time =0.  Only way to recover is to re-start/reboot?

    I'd like you to set the INT1CONT bit located in the  ADCINTSEL1N2 register as part of your ADC setup.  This will eliminate the need for clearing the ADCINTFLG to get future ISRs(you can leave that line in your ISR, it won't have a negative effect).  If this works, then there is likely a code ordering issue with enabling the ISR/INT and the ADC interrupt coming.  If that first ADCINT is missed I can see how no others will get triggered/interrupted.

    Best,

    Matthew

  • Hi Matthew,

    No, The ADC ISRs running 28543 cycle, nCnt_INT_Idts is 28543 and will not be increased forever, that is ADC ISRs can not be entered, Only way to recover is to re-start, i haven't try a reboot. By the way, what is the reboot instruction?

    I will try to set the INT1CONT bit to see if it is useful.

    BR/Alvin

  • I was using re-start/reboot interchangably here, if you had programmed your code into flash and were running standalone I was meaning that to get out of the case you had to assert XRSn, etc.

    For now let's focus on with CCS attached and using Restart.  Will look for your update on INT1CONT option.

    Best,
    Matthew