# dual conversion, ADC channel order question

Question asked by duanemattern on Dec 29, 2016
Latest reply on Dec 30, 2016 by duanemattern

The following screenshot from FreeMaster indicates that ADC_result[0], the first value in the result from the FIFO is ADC0?   Channel 5, with a value of 0x3Fe, (I have the potentiometer maxed at 3.3V).  I see alternativing ADC1, ADC0 in the results, (expected) and I can connect the pot to any port and see the appropriate value change, (if I wire the pot to port E7, then ADC_result[7] tracks ADC_result[0].   If ADC 0&1 were reversed, this is the ADC order that  I would expect.  So I'm just wondering why ADC0 & 1 appear reversed from what I expect?

a) ADC1 result appears first in the FIFO, insted of ADC0 which has a faster conversion time;

b) ADC1 is indicated by a zero in the ADC results (Ref Man. 25.4.3 ADC result), and ADC0 is show with a "1".

5 bits in the upper 16 bits indicate the ADC unit (1bit) and the channel number (4 bits).

Here's how I configired the CTU ADC command list (triggered off PWM VAL0).

CTU_0.CLR[0].R = 0x60A4; // 5, 4 dual, first
CTU_0.CLR[1].R = 0x20C8; // 6, 8
CTU_0.CLR[2].R = 0x20E9; // 7, 9
CTU_0.CLR[3].R = 0x21EA; // F, 10
CTU_0.CLR[4].R = 0x4000; //first, stop
CTU_0.TH1.B.THRESHOLD0 = 0x7;            /* one less thatn # of FIFO 0 entries.*/

{
ADC_0.NCMR[0].R = 0x00F0;          //000-0111-1110-0000 enabled conversion channels
ADC_0.CTR[0].B.INPCMP = 2;        //1.2us at 20Mhz
ADC_0.CTR[0].B.OFFSHIFT = 1;    //tranisition at 1/2 LSB

ADC_1.NCMR[0].R = 0x80E0;          //000-0111-1110-0000 enabled conversion channels
ADC_1.CTR[0].B.INPCMP = 0;        //3us at 20MHz
ADC_1.CTR[0].B.OFFSHIFT = 1;    //tranisition at 1/2 LSB
}