I have a custom KL17 board.
I just tried the following code to read pin E30 which is ADC0_SE23.
Here is my code and it works as expected.
Set up pin MUX
PORTE->PCR[30] = PORT_PCR_MUX(0); // adc - 5v sense
Sorry - Can't figure out how to post code in comment field
word ADC_read16b(void)
{
ADC0_SC1A = ADC_SC1_ADCH(0x17); // start channel ADC23
while(ADC0_SC2 & ADC_SC2_ADACT_MASK){}; //Conversion in progress
while(!(ADC0_SC1A & ADC_SC1_COCO_MASK)){}; //Wait until conversion complete
return ADC0_RA;
}
void test_ADC(void)
{
word R;
SIM_SCGC6 |= SIM_SCGC6_ADC0_MASK;
ADC0_CFG1 |= ADC_CFG1_MODE(3) | ADC_CFG1_ADIV(3); // single ended 16 bit divide bus clock by 8
ADC0_SC1A |= ADC_SC1_ADCH(0x1f); // all channels disabled
R = ADC_read16b(); .... NOTE -- This read value as expected
}
Hope that helps.
Joe