1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#include <avr/io.h> #include <avr/interrupt.h> #include <stdint.h> ISR(TIMER0_OVF_vect) { cli(); sei(); } int main(void) { cli(); /* Enable TIMER0 with interrupt */ TCCR0 |= (1<<CS00); TIMSK |= (1<<TOIE0); /* Go! */ sei(); while(1){ } return 0; }