I used the program given below to read an analog voltage on pin 14/A0. I observed strange values and it took me some hours to learn that the keeper on this pin is enabled and leads to a current into/out of this pin changing the voltage on the pin. There was a keeper issue in the beta-thread but it it is unclear for me how this is handeled. I think activating the keeper is not a good idea since it makes the ADC-input "low ohmic" and may lead to strange results if the source has not a low inner resistance. Is there a specific reason to have the keeper enabled?
Code:
void setup() {
Serial.begin(115200);
while(!Serial) ;
Serial.println("start teensy40doADCtest1...") ;
Serial.println("end setup...") ;
}
volatile int val ;
void loop() {
val = analogRead(0) ;
Serial.printf("ADC= %6d \n",val) ;
delay(500) ;
}