#define DDRB (*(volatile unsigned char *)(0x17 + 0x20)) /* Registrador de direção dos dados da porta B*/
#define PORTB (*(volatile unsigned char *)(0x18 + 0x20))/* Registrador de dados */
#define IRQ7 __vector_7
#define SIGNAL __attribute__ ((signal))
#define GIMSK (*(volatile unsigned char *)(0x3B + 0x20))
#define SREG (*(volatile unsigned char *) (0x3F + 0x20))
#define TIMSK (*(volatile unsigned char *) (0x39 + 0x20))
#define TCCR0 (*(volatile unsigned char *) (0x33 + 0x20))
static int count;
void IRQ7 (void) SIGNAL;
void IRQ7 (void)
{
count--;
if(count == 0)
{
PORTB = ~PORTB;
count = 200;
}
}
int main (void) {
GIMSK = 0xC0;
SREG = 0x80;
TIMSK = 0x02;
TCCR0 = 0X05;
count = 200;
DDRB = 0xff;
PORTB = 0xff;
while (1);
return 0;
}