Specific ports on Teensy 3.6 not reading correct bit resolution using ADC library? I have a basic circuit, where I'm reading analog values from 14 infrared receivers. 

I set the bit resolution to 16 but specific ports are returning 10 bit values (from 0 - 1024) instead of 16 bit values (from 0 - 65536).

I can confirm this is not a problem with my circuitry because when I've tested reading each individual sensor with a port that "works" and the correct range is returned every time.



Here is my code:

#include &lt;ADC.h&gt;

ADC *adc = new ADC();
const int* RECIEVERS = (int[14])
{
    A15, A16, A17, A19, A20, A21, A22, A1, A2, A3, A6, A7, A8, A9
};

void setup() {
    Serial.begin(4608000);
    adc-&gt;setAveraging(16); // set number of averages
    adc-&gt;setResolution(16); // set bits of resolution
    adc-&gt;setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED_16BITS);
    adc-&gt;setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED);
    for (int i = 0; i &lt; 14; i++) pinMode(RECIEVERS[i], INPUT);
}

void loop() {
    for (int i = 0; i &lt; 14; i++) {
        Serial.print(adc-&gt;analogRead(RECIEVERS[i]));
        Serial.print(" | ");
        delay(1);
    }
    Serial.println("");
}




Is there a problem with my code or is my Teensy damaged?
The Kinesis 66 (the chip on the Teensy 3.6) has two ADC modules. Each one talks to different pins.

By default the configuration functions in that library configure ADC0, so unless you tell it otherwise, you will only be configuring half the ADC pins.

You should call each of the configuration functions twice, once for ADC0 and once for ADC1:

adc-&gt;setAveraging(16, 0); // set number of averages
adc-&gt;setResolution(16, 0); // set bits of resolution
adc-&gt;setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED_16BITS, 0);
adc-&gt;setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED, 0);

adc-&gt;setAveraging(16, 1); // set number of averages
adc-&gt;setResolution(16, 1); // set bits of resolution
adc-&gt;setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED_16BITS, 1);
adc-&gt;setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED, 1);