编译环境是ICCV8AVR普通模式溢出中断,调了100遍他死活不进中断
求解。。。
/* */
#include <macros.h>
#include <iom16v.h>
void Delay_ms(int a)
{
int i,j;
for(i = 0;i < a;i++)
for(j = 0;j < 1140;j++);
}
#pragma interrupt_handler
timer1_ovf_isr:iv_TIM1_OVF
void timer1_ovf_isr(void)
{
PORTC = 0xff;
TCNT1H = 0X85;
TCNT1L = 0XED;
PORTC = 0X00;
}
void main(void)
{
TCCR1A = 0X00;
TCCR1B = 0X04;
TCNT1H = 0X85;
TCNT1L = 0XED;
CLI();
TIMSK = 0x04;
SEI();
DDRC = 0xff;
PORTC = 0x00;
while(1)
{
;
}
}
(用protues仿的,PORTC端口一直是小蓝点)
我找到问题了,还是谢谢您
一周热门 更多>