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.

ADC#01 Silicon Errata

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

  • Stefano,

    The ADC should not be re-triggered during an ongoing conversion. You should take steps to prevent this. Perhaps check if the conversion is completed or not prior to re-triggering or extend the time between triggers to guarantee completion.
  • In fact, in my application I need reset the ADC and then restart it also during continuous conversion run.
    How I can do this?

    My problem is that every time the ADC is completely blocked, I tried to reset everything, but has no effect, the only solution is to turn off.
    This problem may be caused by reset and restart the ADC during continuous conversion? It could be the silicon errata ADC#01?

    How can I prevent the restart during conversion in continuous conversion configuration ?


    Thanks

  • Hello Stefano,

    Yes, I do believe that this is a symptom of ADC#01 based on your description.

    Unfortunately, I don't clearly understand your application implementation so some questions follow.

    - Are you using an encoder to trigger the timer as a pulse counter which in turn will trigger the ADC conversions?

    - Is the interrupt rate of the timer causing the re-triggering of the ADC conversion to quickly due to the speed of the motor?

    - Or, as you mentioned in your last post, are you running the conversions continuously (not necessarily triggering off of Timer/pulses) and the timer interrupt initiates a "reset and restart of the ADC" in order to synchronize the ADC conversions with some event?

    - If attempting to synchronize what are you trying to synchronize to?

    - What is the comparator being used for; current calculations?

    - When you state that you reset and restart the ADC during continuous conversion, what does this mean exactly? What steps are you taking? Can you post the code you are using for this activity?

    - Finally, in regard to the ADC interrupt, can you have a look at the interrupt flag and verify it is clear and not pending when the ADC gets "locked?"
  • Deae Chuck, thanks very much for your support.

    I try to explain my application.
    I have Timer0A that run at the motor speed, when trigger i set the output pole and re-triggering the ADC0 and ADC1 comparator with continuous conversione (ADC_TRIGGER_ALWAYS).
    The ADC comparatore is configured for reach the current value desidered.
    When trigger the ADCx comparator trigger i reset the output and start a timer1 for TOFF.
    At the end of TOFF (timer1) I set the pole and re-triggering the ADC0 and ADC1 comparator.

    When this happens the problem I don't have connected the emulator, so I don't know the situation of the processor registers.

    At the end of timer0A for reset and restart the ADC comparator the code is:

        //RESET ADC
        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);
        HWREG(ADC0_BASE + ADC_O_OSTAT) = ADC_OSTAT_OV3;
        HWREG(ADC0_BASE + ADC_O_USTAT) = ADC_USTAT_UV3;
        ADCComparatorIntClear(ADC0_BASE, 0x01);     //Clear interrupt to proceed to  data capture
        IntPendClear(INT_ADC0SS3);

        //START ADC comparator
        ADCComparatorRegionSet(ADC0_BASE, 0, Current1, Current1);
        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

    Finally my doubt is: When ADC#01 presents the ADC is completely blocked ?
    When you present my problem the ADC is fully locked (verified with pin used as debug)

  • Stefano,

    I don't understand why you need to reset and restart the ADC if it is already in continuous conversion mode. I would simply wait for the sequencer to finish all of its ongoing conversions, clear the interrupts, discard/clear the ADC data, and continue. This process should happen faster than our reset. reinitialize, and restarting of the sequencer/ADC conversions and provide better alignment with your tasks.
  • I reset the ADC because I change the analog input pin control for read one time the voltage level and after return to analog comparator for current control.
  • Hello Stefano,

    Is there a reason why you couldn't make use of a different ADC channel/input and sequencer for this purpose and prevent the need to reconfigure the ADC in your interrupt?
  • Yes, the reason is that I have both ADC already used for pole1 and pole2 .

    Now I have solved the problem in this mode:

    - When the Timer0A that run at the motor speed, trigger during a ADC conversion of other analog input, I don't reset the ADC for start the current comparator and wait the end of conversion. In this mode I prevent the ADC#1 errata silicon.

    But, my question is: When the ADC#1 errata occours the ADC remains locked until the power off microcontroller ?


    Thanks for your help

    Stefano

  • Stefano,

    The errata states:

    Re-triggering a sample sequencer before it has completed its programmed conversion

    sequence causes the sample sequencer to continuously sample. If interrupts have been

    enabled, interrupts are generated at the appropriate place in the sample sequence. This

    problem only occurs when the new trigger is the same type as the current trigger.

    Since you were resetting and restarting the ADC, I don't think this would have been your issue. It may be a combination of things that caused the locking issue requiring the power cycle to correct. As noted int he errata, when the issue occurs, the sequencer will continue to sample ADC channels. If interrupts are setup to fire on ADC channel completion, they would still occur, if they are setup to occur at the completion of all of the channels in the sequencer, they would/should fire on each iteration per the errata.

  • Hello Stefano,

    The ADC lockout condition would mean that without re triggering the ADC will continuously perform sample conversions. If the ADC clock is disabled and the ADC controller is reset then it should recover the controller. There should not be any need to perform a power cycling of the micro.

    Regards
    Amit