Hi,
I have a different behavoir of the same software on these two different revision of the arduino uno. The old revision 2 works like expected, the newer (latest) revision 3 always reads 1023 on the analog input pin 0. I tried it out with two blank boards (rev2 vs rev3) using a simple potentiometer to test it.
..I can add the code, which produce the "problem". If I leave it out eveything is fine on the blank arduino boards:
pinMode(currentSensePin, INPUT); // PD7
// ACD=0, ACBG=0, ACO=0 ACI=0 ACIE=0 ACIC=0 ACIS1=1, ACIS0=0
// - interrupt on falling edge
ACSR = 0b00000010; //ACBG=0 -> AIN0 is applied to the positive input of the Analog Comparator
// ADEN=1
ADCSRA = 0b00000000; // ADC is switched off for doing configuration
// ACME=0 (off) ADEN=0 MUX = b000 for use of AIN1
ADCSRB = 0b01000000; // AIN1 is applied to the negative INPUT of the analog comparator
ACSR |= 0b00010000; // clear pending interrupts
DIDR1 = 0b00000011;
ok, thanks for your patience.
for some strange reasons the posted code works on ONE uno rev2 board and on no rev3 or different rev 2 board. I fixed it by reseting my special setting while measuring the voltage on the analog input pin and after that I reconfigure my pins for comparator interrupt like in the posted code...