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 output flatlining

Other Parts Discussed in Thread: MSP430F436

We have a situation on a MSP430F436 where the ADC  output freezes at a particular output and then after 1 minute reverts back to where it should be. Has anyone experieced any similiar problems as we cannot see how it could be our code.

 

 

  • Hello Ian,

    can you specify the ADC configuration? what clocks the conversion clock? 

  • Possibly you do not have properly configured channels ADC few analogues are reading, in what way and what is the configuration of the clock, I need more information to help
    Thanks!

  • Hi Leonardo,

    I have more information about Ian (and mine) problem:

    What is actually happening, every minute we initialises the ADC:

    ADC12CTL0 &= ~(ENC + ADC12SC);               /* Disable conversion to allow ADC registers to be modified. */

    ADC12CTL0 = 0x01F0U;                          /* Sample time = 1 + 8 ACLK periods, multiple sample & convert, 2.5V ref, ref on, ADC on. */
    ADC12CTL1 = 0x020EU;                          /* Repeat sequence-of-channels. ACLK (32KHz), divide clock by 1 */
    ADC12MCTL0 = 0x10U;                           /* Volts, Vref = internal reference, A0. */
    ADC12MCTL1 = 0x11U;                           /* mA/PRT+, Vref = internal reference, A1. */
    ADC12MCTL2 = 0x12U;                           /* Spare, Vref = internal reference, A2. */
    ADC12MCTL3 = 0x13U;                           /* Vref = internal reference, A3. */
    ADC12MCTL4 = 0x9AU;                           /* temperature diode, end of sequence, internal reference. */  

    ADC12IE = 0x0010U;                              /* Enable interrupt for ADC Mem4. */

    ADC12CTL0 |= (ENC + ADC12SC);            /* Start conversion! */

    Every 6 - 10 hours (no pattern), the all conversions stops/hangs for one minute exactly (the time the initialisation occurs again).

    During this time, no interupts occur in the ADC12IFG register.

     

     

  • I'm new to the MSP430 so this might be a dumb question. What's the purpose of re-initializing 'Repeat sequence-of-channels' every minute? Since it hangs for exactly one minute it would appear that the problem occurred during the previous initialization.

  • Hi Joseph, Thanks for your interest - there are no dumb questions. The reason why we refresh every minute is our products could run for months or years without being powered cycled. There is no way the guaranteeing these RAM registers do not get corrupted from external influences. Certainly we see products being corrupted during EMC testing, but the standard allow the product to self-recover. Hope this helps.

  • Paul McKenna said:
    What is actually happening, every minute we initialises the ADC: [...] hangs for one minute exactly

    This smells like there is a racing condition that sometimes makes your re-initialization and restart fail.

    Now I never stopped a repeated sequence of channels for re-initialization, so I can only guess, but maybe you'll have to check whether your interruption was successful before you reconfigure.

    From users guide:

    "Resetting ADC12ENC during a sequence or repeat-sequence mode stops the converter at the end of the sequence."

    Depending on when exactly you clear ENC, it may be that your interrupt is recognized but the restart is ignored.

    So you should clear ENC and in the ISR that tells you the end of the sequence, check for ENC being clear and if so, reconfigure and restart. This saves you busy-waiting for the end of the sequence (ADC12BUSY).

    I agree that there is a possibility that a register may change due to ionization events. But this also applies as much to the timer configuration (or whatever generates our 1 minute cycle) and the interrupt settings etc.

    So while you cure one possible problem, you generate another one which is as large.

  • Update on progress: I have proved it is disabling or enabling that is causing the problem, not refreshing the registers. The problem has been solved by stopping all conversions using ADC12CTL1 &= ~(CONSEQ0 + CONSEQ1).

  • Yes, switching to single conversion mode before clearing ENC is the reqommended way to immediately stop an ongoing sequence. This is documented in the users guide.