#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 16000000UL
void initTimer(void)
{
/*OCR0A = 0;*/
//TCCR0A = (1<<COM0A1); //Non-inverting mode
//TCCR0B = (1<<CS02) | (1<<CS00); //1024 prescaler
TIMSK0 = (1<<TOIE0); //Overflow interrupt
}
ISR(TIMER0_OVF_vect)
{
int cnt = 0;
cnt++;
if (cnt == 255)
{
cnt = 0;
//TCCR0A ^= (1<<WGM01) | (1<<WGM00);
if (cnt < 9)
{
PORTD ^= 0xFF;
}
}
TCNT0 = 65223;
}
int main()
{
DDRD = 0xFF;
//TCNT1 = 65223;
//PORTD = 255;
initTimer();
while(1)
{
}
}