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.

ADC10 input channel changing after read.

Intellectual 400 points

Replies: 3

Views: 501

I'm using the MSP430FR5725.  I want to read and store the ADC results of pins A15, A14, and A1.  To do this, I am doing a sequence of channels operation.  I am accomplishing this in an interrupt handler by resetting ADC10SC.  This decrements the channel that is currently being read in.  Once I get to A0, I disable the interrupt and go about my main code.  I have this running continuously while in a low power state until a certain action stops the interrupt and wakes my system.  This works fine.  However, when I want to enable the ADC in subsequent reads, the INCH value decrements, so now it doesn't start at A15, but rather A14 and so on.  I think it is setting ADC10SC after a read has completed, then proceeding with normal operation of the main software.

I can post my code in a little bit.  Currently, I am unable to.  Any help/idea is appreciated.  Thank you.

3 Replies

  • Guru 46710 points

    Are you sure you use ADC10CONSEQ correctly?

  • When you don't need A13..A2 and A0, I think you should go for single channel single conversion mode. When a conversion is done, change the channel number and start the next conversion.
    In sequence mode, yo do not only 13 superfluous conversions, you also affect the digital operation on these 13 inputs, as the port logic will (at least on some MSPs) deactivate the digital port function during the sampling process, causing glitches if you need these pins for different things.

    _____________________________________

    Time to say goodbye - I don't have the time anymore to read and answer forum posts. See my bio for details.

    Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
    I'm sorry that  I can no longer provide help  in the forum or by private conversation.

  • In reply to Jens-Michael Gross:

    When I called the ADC interrupt, I did so in a function:
    void adc_read(void)
    {
       //enable interrupt
       //enable, start conversion
    }
    
    
    This was the function I was using that set my INCHx to get off track.  I then changed it to:
    void adc_read(void)
    {
       //enable interrupt
       //enable, start conversion
       //while ADC10BUSY
    }
    I have yet to get any problems after this change.

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.