我写了个AT90S8515定时器1溢出中断的程序,可是不进中断。
请高手帮忙看看,谢谢!
#include"avr/io.h"
#include<interrupt.h>
#define uint unsigned int
#define uchar unsigned char
void sysinit(void)
{DDRD=0X3F;
DDRB=0XFF;
PORTD=0X00;
PORTB=0X3F;
DDRC=0XFF;
PORTC=0XFF;
TIMSK=0X80;
TCCR1B=0;
TCNT1H=0X89;
TCNT1L=0XE6;
TCCR1A=0;
TCCR1B=1;
sei();
}
#pragma interrupt_handler timer1_isr:7
void timer1_isr(void)
{TCNT1H=0X89;
TCNT1L=0XE6;
PORTC^=1;
}
int main(void)
{uchar tmpkey;
MCUCR=0;
sysinit();
while(1);
} |