Setting the interrupt control bit is located in the ADCSRA Control and Status Register. The bit to set in this register is ADIE (Analog to Digital Interrupt Enable).
Optionally, we can check the ADIF flag to manually determine if the ADC has completed a conversion.
Remember that the global interrupt must be set sei(); and the interrupt service routine and vector is established and another conversion is started within this service routine.
Example:
ISR(ADC_vect)
{
//Some code that will run when a conversion is complete,
//like getting the ADC data
//Set the ADSC in the ADCSRA register to start another conversion
}
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.