#define TIMER0 __vector_7 #define SIGNAL __attribute__ ((signal)) #define PORTB (*(volatile unsigned char *)(0x38)) #define DDRB (*(volatile unsigned char *)(0x37)) #define SREG (*(volatile unsigned char *)(0x5f)) #define TCCR0 (*(volatile unsigned char *)(0x53)) #define TIMSK (*(volatile unsigned char *)(0x59)) int counter = 0; void TIMER0(void) SIGNAL; void TIMER0(void) { counter++; if (counter == 230) { PORTB = ~PORTB; counter = 0; } } int main(void) { TIMSK = TIMSK | 0x02; SREG = SREG | 0x80; TCCR0 = TCCR0 | 0x05; DDRB = 0xff; while(1) { } return 0; }