#include <avr/io.h>
#include <avr/interrupt.h>
ISR(TIMER0_OVF_vect) {
// XOR PORTA with 0x01 to toggle the second bit up
PORTA=PORTA ^ 0x04;
TCNT0=256-78;
}
int main( void ) {
DDRA = 0xFF; // Configure PORTA as output
PORTA = 0xFF;
TIMSK1 |= (1<<TOIE1); // enable timer overflow interrupt for Timer1
TCNT0=256-78;
TIFR1 |= (1<<TOV1);
TCCR1B = (1 << CS10) | (1 << CS12); // turn on 16 bit timer1 also with /1024
sei(); // enable the global interrupts
while(1) {
}
}