Help! Analog Comparator+Interrupt Rising Edge

Is the code below sufficient to use analog comparator to compare AIN0 and AIN1? How can I see the pulses/levels when AIN0 >AIN1 at the Interrupt Rising Edge. Any sample codes, please?

I don't see any code.

Sorry, here’s it:

ACSR = 
 (0<<ACD) |   // Analog Comparator: Enabled
 (0<<ACBG) |   // Analog Comparator Bandgap Select: AIN0 is applied to the positive input
 (0<<ACO) |   // Analog Comparator Output: Off
 (1<<ACI) |   // Analog Comparator Interrupt Flag: Clear Pending Interrupt
 (1<<ACIE) |   // Analog Comparator Interrupt: Enabled
 (0<<ACIC) |   // Analog Comparator Input Capture: Disabled
 (1<<ACIS1) | (1<ACIS0);   // Analog Comparator Interrupt Mode: Comparator Interrupt on Rising Output Edge

That code looks OK to me. You should also write 0 to ADCSRB to ensure that the negative input comes from AIN1 and not the ADC multiplexer.

To hook the interrupt, see http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272923299.

I need a little help.
I’m using the ACSR to trigger an interrupt on a rising edge above about 1.4v.
My problem is that I can detect the first pulse sent to pin 6, which triggers the interrupt and sets logPin to HIGH, but for some reason it stays HIGH for ever despite the code in the loop to bring it back to LOW. Any ideas?

int counter = 0;
int logPin = 3;

void setup()
{
  Serial.begin(9600);
  pinMode(logPin, OUTPUT);
  digitalWrite(logPin, LOW);
  ACSR =
  (0<<ACD) |   // Analog Comparator: Enabled
  (0<<ACBG) |   // Analog Comparator Bandgap Select: AIN0 is applied to the positive input
  (0<<ACO) |   // Analog Comparator Output: Off
  (1<<ACI) |   // Analog Comparator Interrupt Flag: Clear Pending Interrupt
  (1<<ACIE) |   // Analog Comparator Interrupt: Enabled
  (0<<ACIC) |   // Analog Comparator Input Capture: Disabled
  (1<<ACIS1) | (1<ACIS0);   // Analog Comparator Interrupt Mode: Comparator Interrupt on Rising Output Edge
}

void loop()
{
  if (logPin == HIGH)
  {
    counter++;
    delay(100);
    digitalWrite(logPin, LOW);
  }

  Serial.print("Counter:");
  Serial.println(counter, DEC);

}

ISR(ANALOG_COMP_vect)
{
  digitalWrite(logPin, HIGH);
}

The line "if (logPin == HIGH)" should be "if (digitalRead(logPin) == HIGH)". The expression "logPin == HIGH" is equivalent to "3 == 1".

Ok, makes sense. Thanks for the help, I'll test it asap.