I am trying to learn how to use Timer1 on the butterfly in output compare mode. This test code compiles and runs fine on an atmega 8 or 32 but fails with messages shown in the gif below on a 169...why does it fail? it seems not to recognize TIMSK, TIFR. Is there a difference in using Timer1 on the 169???
//timer1-6.c for atmega8 #include#include #include #include int main( void) { sei(); //enable interrupts DDRD = 0xFF; //PORTD set as output TCNT1L = 0; TCNT1H = 0; OCR1AH = 0x01; //output compare High and Low bytes OCR1AL =0x0E; TCCR1A = 0x00; //timer counter control register TCCR1B &= ~(0 <<WGM13); //Clear on compare TCCR1B |= (1 << WGM12); TCCR1B |= (1 << CS11); TCCR1B |= (1 << CS10); TIMSK |= ( 1 << OCIE1A); //Timer1 Output Compare Enable TIFR |= (1 << OCF1A); //Timer1 Output compare A match flag while(1); } //toggles PORTD as test SIGNAL(SIG_OUTPUT_COMPARE1A) { PORTD = ~PORTD; }