Using the Analog Comparator and the ADC on the Mega2560

What I would like to do is have 5 or 6 analog buttons on 1 pin (using AnalogButtons library). Then have the Analog Comparator generate an interrupt when it detects a button press from the change in voltage on the pin used for the buttons. Then use that interrupt to start the ADC using the same pin, or another analog input pin tied to that same pin, to figure out which button was pressed.

The reason I want to do this is to free the processor for other tasks, instead of polling for a button press.
Is this possible? I know the analog comparator can trigger the input capture module, but can it trigger the ADC to read the value of an analog input? Is there a simpler way of doing this?

Thanks for any input on this,
DigitalJohnson

Check that the AIN0 and AIN1 pins of the comparator are accessible on the Mega board.
You can start a conversion in the ISR, but this may interfere with other analogRead's. I'd simply poll the comparator flag and proceed as required.

Thanks for the heads up about the accessibility of the AIN0/AIN1 pins. I did some more research and the AIN1 pin is accessible via hardware. However, the AIN0 pin is not accessible by hardware. There does appear to be a way around that problem with software. The analog comparator has the Digital Input Disable Register 1 (DIDR1). Bit 0 disables the digital input for PE2 (aka AIN0). If I don't disable the digital input of this pin and set it to output high or input w/pullup enabled, that should put +5 volts to AIN0. I haven't tested this yet. I'll update this post for anyone interested in using the analog comparator on the Mega.

The DIDR1 register does not influence the comparator operation. It only modifies the behaviour of AIN0/1 as digital inputs.
But ACSR.ACBG can be used to replace the external AIN0 signal by the internal bandgap reference.