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.

MSP430G2553 ADC Configuration

I am trying to use the ADC to read the voltage from a potentiometer in order to the vary the frequency of a quadrature signal. I have the quadrature signal setup but I can not get the ADC to trigger interrupts to read in voltage values. I am using Grace to configure the ADC. What am I doing wrong?

8508.QuadratureGenerationWithPotentiometer.zip

  • GRACE is for configuring your peripherals, not for operating them.
    So it initializes the ADC (channel and reference setup etc.) but never actually starts it. Starting the ADC when appropriate is the job of your code. And you never did.

  • Do you not start the ADC conversions with TACTL |= MC_1? 

  • You’re right. I didn’t analyze the depths of the GRACE configuration.

    You programmed the DTC, which means that the first 127 results are not triggering an interrupt at all, but instead the DTC is copying the results. After these, any further conversion will trigger an interrupt unless you restart the DTC.

    However,  you enter LPM3 at the end of main. And LPM3 means switching SMCLK off, which is the clock source for the timer. So the timer is ‘running’ with 0Hz. Don’t use LPM3 or 4 if SMCLK is required for your operation.

**Attention** This is a public forum