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.

MSP432E401Y: Multiple adc sequencer with multiple channels

Part Number: MSP432E401Y

I would like to setup 10 ADC channels to be sequentially sampled 10 in order.   I have setup my code to use two sequencers Sequencer 0 (first 8 channesl) and sequencer 1 for the last two channels.  I have implemented code similar to this example:

The first 8 channels are configured to be on ADCBufMSP432E4_Seq_0:

#define ADCBUFFERSIZE    (10)
ADCBuf_Conversion continuousConversion1[8];

continuousConversion1[0].arg = NULL;
continuousConversion1[0].adcChannel = Board_ADCBUF0CHANNEL0;
continuousConversion1[0].sampleBuffer = sequencer0BufferOne;
continuousConversion1[0].sampleBufferTwo = sequencer0BufferTwo;
continuousConversion1[0].samplesRequestedCount = ADCBUFFERSIZE;

continuousConversion1[1].arg = NULL;
continuousConversion1[1].adcChannel = Board_ADCBUF0CHANNEL1
continuousConversion1[1].sampleBuffer = NULL;
continuousConversion1[1].sampleBufferTwo = NULL;
continuousConversion1[1].samplesRequestedCount = ADCBUFFERSIZE;

 .
 .
 .

(similarly chans 2-6 in between);

continuousConversion1[7].arg = NULL;
continuousConversion1[7].adcChannel = Board_ADCBUF0CHANNEL7;
continuousConversion1[7].sampleBuffer = NULL;
continuousConversion1[7].sampleBufferTwo = NULL;
continuousConversion1[7].samplesRequestedCount = ADCBUFFERSIZE;

 ADCBuf_convert(adcBuf, &continuousConversion1, 8) ;

Similarly for Sequencer 1 with the last two channels (configured to be on ADCBufMSP432E4_Seq_1)

continuousConversion2[0].arg = NULL; 
continuousConversion2[0].adcChannel = Board_ADCBUF0CHANNEL8;
continuousConversion2[0].sampleBuffer = sequencer0BufferOne; 
continuousConversion2[0].sampleBufferTwo = sequencer0BufferTwo; 
continuousConversion2[0].samplesRequestedCount = ADCBUFFERSIZE; 

continuousConversion2[1].arg = NULL; 
continuousConversion2[1].adcChannel = Board_ADCBUF0CHANNEL9;
continuousConversion2[1].sampleBuffer = NULL; 
continuousConversion2[1].sampleBufferTwo = NULL; 
continuousConversion2[1].samplesRequestedCount = ADCBUFFERSIZE;

ADCBuf_convert(adcBuf, &continuousConversion2, 2);

However, I don't get channel 8 and 9 in order but seems to appear every several readings. I am seeing that the buffer size of 10 typically has readings from channels:

Ch0
Ch1
Ch2
Ch3
Ch4
Ch5
Ch6
Ch7
Ch0
Ch1

then next buffer:

Ch2
Ch3
Ch4
Ch5
Ch6
Ch7
Ch0
Ch1
Ch2
Ch3


Occassionally I will get ch8 and ch9 readings in the buffer.


Questions: 

1.  How can I get the following order each time when ch8 and Ch9 are on a differenent sequencer?

Ch0
Ch1
Ch2
Ch3
Ch4
Ch5
Ch6
Ch7
Ch8
Ch9

  • Sean_,

    You are passing the same handle, adcBuf, for both sequencers. Create two handles, open both, then try starting both sequencers again.

    See the MSP432E4 SimpleLink Academy lab, ADC Simultaneous Sampling, here.

    BR,

    Seong

  • Thanks for the reply. 

    Yes, this was done intentionally as I would like to use the same ADC module (ADC0) but different sequencers.  Using the same handle is similar to the adcBufmultisequencer example.

    Also, I am looking to do 10 channels sequentially. 

    Sequencer 0 has a max number of 8 channels.  Is there any reason this was designed this way?  Is there a way to get more than 8 channels to be sequenced on one sequencer?

  • Sean,

    Please see this related thread: 

    FYI - The example provided uses driverlib.

    No, SS0 supports up to only 8 channels and its corresponding FIFO depth is 8 as well. SS1~SS3 supports even less.

    BR,

    Seong

**Attention** This is a public forum