Analog Comparator on Mega 2560

I've been successfully testing the analog comparator on an Arduino Uno using pin 7 (AIN1) and setting the positive input of the comparator to use the internal voltage:

pinMode(7,INPUT);
ACSR = B01011011; // comparator interrupt enabled and tripped on falling edge.

ISR(ANALOG_COMP_vect)
{
// Interrupt code here
}
}

I now want to move this code to a Mega 2560. Looking at the pin mapping of the ATmega2560 it appears to use pin 5 for AIN1.

Will the comparator work the same with the Mega 2560 by just changing the input pin from 7 to 5?

Thanks in advance

Will the comparator work the same with the Mega 2560 by just changing the input pin from 7 to 5?

Yes, I would expect that.

ACSR = B01011011; // comparator interrupt enabled and tripped on falling edge.

According to the datasheet your comment is wrong. The combination of 1 1 for ACIS0 and ACIS1 triggers an interrupt on a rising (and not falling) edge.

Ok thanks. I'm going to try it this weekend.
Your'e right about the comment. The code was modified during trials but not the comment.