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
