// the prescaler can not devide this to archieve a toggling condition since OCR0A is small
void timer1_init() {
// Set Timer1 for 1-second intervals
DDRD |= (1 << PD6);
TCCR0A |= (1 << 1)|(1<<6);
TCCR0B |= (1 << 0); // Configure timer in CTC mode
TCNT0 = 0;
OCR0A = 255;//15624;// Set compare value for 1Hz (1 sec) with 8MHz clock and 1024 prescaler
TCCR0B |= (1 << CS02) | (1 << CS00); // Set prescaler to 1024
TIMSK0 |= (1 << OCIE0A); // Enable Timer1 Compare A interrupt
sei();
}
int main(){
timer1_init();
while(1){
//
}
}