I can use the CTC waveform generation mode to loop to OCRnA
and trigger the corresponding TIMER1_COMPA_vect
interrupt.
// CTC mode
TCCR1A &= ~(1 << WGM10);
TCCR1A &= ~(1 << WGM11);
TCCR1B |= (1 << WGM12);
TCCR1B &= ~(1 << WGM13);
TIMSK1 |= (1 << OCIE1A);
OCR1A = 250;
ISR(TIMER1_COMPA_vect) {}
But if I use CTC mode with ICRn
as "TOP" is there a corresponding interrupt vector?
TCCR1A &= ~(1 << WGM10);
TCCR1A &= ~(1 << WGM11);
TCCR1B |= (1 << WGM12);
TCCR1B |= (1 << WGM13);
TIMSK1 |= (1 << ???); // which interrupt to enable?
ICR1 = 250;
ISR(???) {} // which interrupt vector?
TIMSK1 |= _BV(ICIE1);
ISR(TIMER1_CAPT_vect)
, but looking at the datasheet, that's not supposed to work. It works, but it's not specified behavior.