#include<avr/io.h>
#include<avr/signal.h>
#include<avr/interrupt.h>
#include<util/delay.h>
#define uint unsigned int
#define uchar unsigned char
static uchar interrupt ,count;
static uchar b;
uint a;
SIGNAL(SIG_OVERFLOW1)/*溢出中断*/
{
TCNT1H=0X7F;
TCNT1L=0XFC;
interrupt++;
if(interrupt==a)
{
interrupt=0;
PORTD=~PORTD;
}
}
void timer()
{
TCCR1A=0x00;
TCNT1H=0X7F;
TCNT1L=0XFC;//{(0xff-0xb2)+1}*1*(1/8MHZ)=0.1ms
/*TCNT1L=0xb1;*/
TCCR1B=1;//控制寄存器,1分
TIMSK=0x04;//中断屏蔽寄存器,定时器0溢出中断使能
sei();
}
uchar data[