Dear all, I have a tm4c123ah processor.
In my control motor application I have 2 ADC used as digital comparator and a timer, both with interrupt at the same level.
ADCIntDisable(ADC0_BASE, 3);
ADCIntClear (ADC0_BASE, 3);
ADCComparatorIntDisable(ADC0_BASE, 3);
ADCSequenceDisable(ADC0_BASE, 3);
ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_ALWAYS, 0);
ADCSequenceStepConfigure(ADC0_BASE, 3, 0,ADC_CTL_CH2 | ADC_CTL_END | ADC_CTL_CMP0);
ADCComparatorReset(ADC0_BASE, 0, true, true);
ADCComparatorIntClear(ADC0_BASE, 0x01); //Clear interrupt to proceed to data capture
IntPendClear(INT_ADC0SS3);
ADCComparatorRegionSet(ADC0_BASE, 0, value1, value1);
ADCComparatorIntClear(ADC0_BASE, 0x01); //Clear interrupt to proceed to data capture
IntPendClear(INT_ADC0SS3);
ADCIntClear(ADC0_BASE, 3);
HWREG(ADC0_BASE + ADC_O_IM) |= 0x80000;
ADCSequenceOverflowClear (ADC0_BASE, 3);
ADCSequenceUnderflow (ADC0_BASE, 3);
ADCSequenceEnable(ADC0_BASE, 3); //It is always a good practice to disable ADC prior
Sometime if happens that the adc comparato is locked and the interrupt not trigger .
It may happen that: during the timer interrupt routine re-trigger the adc comparator during a adc conversion.
This problem can be caused from ADC#1 errata ?
What does the phrase "the sample sequencer to continuously sample" in the comparator configuration whith trigger always ?
- The interrupt is locked ?
Thanks
Stefano