#include #include #include #include #include volatile char flag; char temp; volatile uint8_t clk; volatile uint8_t dummy; int main (void) { clk = TCNT0 = 0; /* Enable the Timer0 overflow interrupt. */ TIMSK = _BV (TOIE0); /* Start the timer/counter running at the CPU clock rate. */ TCCR0 = _BV (CS00); sei (); while (1) { /* Chew up some MCU cycles. */ clk += TCNT0; //dummy -= TCNT0; } return 0; } SIGNAL(SIG_OVERFLOW0) { flag = ~flag; }