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 10 single sequence

Other Parts Discussed in Thread: MSP430F2274

Hello,

I'm using ADC10 on MSP430f2274.

I have 6 inputs, which are A12, A4 down to A0, well I know that the ADC on single sequence starts from A12 down to A0,

but in my case I don't need it to covert data of A11, A10, A9, A8, A7.(if it does convert thous inputs, what is the number of conversion should I put on the ADC10DTC1 register?).

If not, should I declare only a 6 element array to read my data from ADCMEM?

Thanks

  • Mohamed Amini said:
    If not, should I declare only a 6 element array to read my data from ADCMEM?

    User's guide says:

    A sequence of channels is sampled and converted once. The sequence begins with the channel selected
    by INCHx and decrements to channel A0. Each ADC result is written to ADC10MEM. The sequence stops
    after conversion of channel A0

    So answer is: you should declare 13 element array and convert 13 inputs.

  • Mohamed Amini said:

    Hello,

    I'm using ADC10 on MSP430f2274.

    I have 6 inputs, which are A12, A4 down to A0, well I know that the ADC on single sequence starts from A12 down to A0,

    but in my case I don't need it to covert data of A11, A10, A9, A8, A7.(if it does convert thous inputs, what is the number of conversion should I put on the ADC10DTC1 register?).

    If not, should I declare only a 6 element array to read my data from ADCMEM?

    Thanks

    I wonder if it would be more efficient to do a single A/D for A12 and put the result in mem0, then reconfigure the A/D to do a DMA Single Series for A4 thru A0 with the results going to mem1 thru mem5, then set up to repeat the same cycle again?

  • I think that will slow it down #Joseph 

  • Depending on the conversion time, switching between an A4->A0 sequence and a single A12 conversion may take more time than sampling through the superfluous channels in a single sequence.

    However, during sampling of these unwanted channels, the ADC may disable the digital I/O pins for the sampling period (see the port pin schematics of your MSP). This may affect your external hardware. In this case, you don't have any option but to switch operating mode.

  • Jens-Michael Gross said:
    However, during sampling of these unwanted channels, the ADC may disable the digital I/O pins for the sampling period (see the port pin schematics of your MSP). This may affect your external hardware. In this case, you don't have any option but to switch operating mode.

    Yes it does, 

    I used to get my result using this line of code, will it work in switch operation mode?

    ADC10SA = (unsigned int)resultsA;
  • Using the DTC for storing results only makes sense if you have a sequence or multiple conversions. It can be used for a single result, but the overhead is larger than handling things directly.

    You should go this way:
    setup ADC for sequence
    Setup DTC for 5 results
    Start sequence
    ADC samples 4-3-2-1-0, DTC copies results to SA, SA+1 etc.
    DTC gives ADC10 interrupt
    in ISR, setup ADC for channel 12, single conversion
    start single conversion
    ADC gives ADC10 interrupt
    in ISR copy the result to SA+5 manually
    setup DTC for 5 results,
    Setup ADC for sequence
    start sequence
    wake main (or set a flag), so main can process the results.

**Attention** This is a public forum