I have been writing my own "library" to handle different inits on an AVR chip. However, I am stuck on the action of the ADIE bit in the ADCSRA register (p.261 in the datasheet). The datasheet doesn't really explain how ADIE works. However, I haven't been able to get a reading out of the ADC whenever ADIE is set to 0. Why is that? I thought that the ADC worked like the timers- even if the interrupt isn't enabled, it would still be updating the ADC registers with readings.
This is the culprit code, whenever "interrupt" is set to anything but 1, the ADC doesn't work. Interestingly, unlike other interrupts, if there is no code within the ISR(ADC_vect) routine, the chip doesn't get stuck.
if(interrupt){ADCSRA|=1<<ADIE;}//enable the ADC conversion complete interrupt
else{ADCSRA&=~1<<ADIE;}