#include <avr/io.h>
#include <avr/interrupt.h>
void initialization()
{
// set up timer with prescaler = 64 and Normal mode
TCCR1A = 0;
TCCR1B |= (1 << CS12)|(1 << CS10);
TCNT1 = 2^6-25000; // initialize counter
TIMSK1 |= (1 << TOIE1); // enable timer overflow interrupt
sei(); // enable global interrupt
}
int main(void)
{
DDRC |= (1 << PC0); // connect led to pin PC0
initialization();
while(1) {};
}
ISR (TIMER1_OVF_vect)
{
TCNT1 = 2^6-25000; // initialize counter
PORTC ^= (1 << PC0); // toggle led here
}