#include <avr/io.h>
#include <avr/interrupt.h>

int main(){          // Hauptprogramm
  PORTB = 0xff;
  DDRB = 0xff;
  TCCR1B |= 1<<WGM12;// Timer im CTC-Mode mit OCR1A als Top
  TCCR1B |= 2;        // Systemtakt durch 8
  TIMSK |= 1<<OCIE1A; // Timer/Counter1 Output Compare Match A Interrupt Enable
  OCR1A = 62499;      // Vergleichswert Timer wieder auf 0
  sei();             // globale Interruptfreigabe
  while(1);          // Endlosschleife
  return 0;
}

ISR(TIMER1_COMPA_vect){ // Interrupt Service Routine
  PORTB ^= 1;           // Ausgang PB0 invertieren (PINB = 1)
}