#include<avr/io.h>
#include<avr/iom16.h>
//#include<avr/interrup.h>
void main()
{
DDRA=0XFF;
DDRD=0XFF;
PORTA=0xff;
TIMSK = 0x00; //timer interrupt sources
SREG|=0x80;
TCNT0=255-225;
TCCR0=0x01;
TIMSK |= (1<<TOIE0);//使能定时器0中断
while(1);
}
SIGNAL(TIMER0_OVF_vect)
{
//TIFR|=0X01;
PORTD=~PORTD;
}
|