#define uchar unsigned char
#define uint unsigned int
#define led PORTB.0
#define LED_ON 0
#define LED_OFF 1
uint mark = 0;
// Timer1 overflow interrupt service routine
interrupt [TIM1_OVF] void timer1_ovf_isr(void)
{
// Reinitialize Timer1 value
TCNT1=0x64;
// Place your code here
mark++;
}
没用过ATMEL,看了10分钟的文档,貌似你的SREG 全局中断没开!!!
还有养成“进中断,清中断”的习惯,虽然这货是硬件清除的FLAG。
When the SREG I-bit, and TOIE1 (Timer/Counter1 Overflow Interrupt Enable), and TOV1 are set(one), the Timer/Counter1 Overflow interrupt is executed.