I have been told by my teacher that it is somehow possible to make a ADC timer interrupt.
You might have asked him or he could explain it ;)
Generally, if you want to do anything with an Arduino, which isn't implemented by the Arduino libraries, you're going to have to roll your own code (or copy it from the internet).
The answer from Nick will most certainly be enough to help you with the problem. However, it'd be way more cooler to find out how you can solve these problems yourself.
I couldn't find a duplicate of this question, though it's a rather common question. You should've checked some of the tutorials on the web, it'll get you started a lot faster.
But don't forget the datasheet and manuals of the ATMega328(P). In case you can't really find something that fits your needs, or if you want to check some background information.
Setting registers (ADC)
This piece of code (from Nick Gammon), sets up the ADC.
ADCSRA = bit (ADEN); // turn ADC on
ADCSRA |= bit (ADPS0) | bit (ADPS1) | bit (ADPS2); // Prescaler of 128
ADMUX = bit (REFS0) | (adcPin & 0x07); // AVcc and select input port
Fair enough, but if you wanted to change anything of it, you'll think: "How did he ever come up with this."
These are the registers of the microcontroller. By setting bits in the right pattern, you can enable/disable functions or change settings of the microcontroller.
You should download the ATMega328(P) datasheet. You can very easily navigate through it (if you've got a PDF reader that supports "bookmarks").
Check for "24. Analog to Digital converter" you should read through it, and go to "24.9 (Analog to Digital converter) - Register description.".
Here you can see, which bits of (in example) the
ADCSRA register you have to set to enable the adc (
ADEN), start the conversion (
ADSC). And enable interrupts for it (
Since you also want behavior that has to do with interrupts. You should also check out the interrupts bookmark (#12). 12.1 will show you an table with all interrupt vectors.
It's quite a shame that they don't have a nice C example code, they do have an reference manual though, but you'll implement an interrupt handler like this (from Nick Gammon).
// ADC complete ISR
adcReading = ADC;
adcDone = true;
} // end of ADC_vect
If you now want to interrupt on SPI you can check the datasheet or reference manual for the vector name. (