可我写了
还是进不去
为什么?
我的程序是:
#include
#include
/* PORTB definitions */
#define PORTB (*((volatile unsigned char*)(0x0001)))
#define DDRB (*((volatile unsigned char*)(0x0003)))
#define RTICTL (*((volatile unsigned char*)(0x0014)))
#define RTIFLG (*((volatile unsigned char*)(0x0015)))
/* RTI definitions */
/*----------------中断服务程序------------------ */
#pragma CODE_SEG NON_BANKED
interrupt void _RTI_ISR(void){
RTICTL=0x07; //屏蔽中断
RTIFLG=0x80; //清中断标志
PORTB=~PORTB; //输出取反
RTICTL=0x87; //使能中断
}
#pragma CODE_SEG DEFAULT
/*----------------主函数-------------------------*/
void main(void) {
DDRB=0xff; //B口输出
PORTB=0x55;
//RTIFLG=0x80; //分频比是RTR2-RTR0:111 延时65.536MS
RTICTL=0x87; //使能实时中断并清中断
EnableInterrupts; //使能总中断
while(1);
}
/*--------------主函数结束-----------------------*/
我在。PRM文件里设置如下:
NAMES END
SECTIONS
MY_RAM = READ_WRITE 0x2000 TO 0x3FFF;
MY_ROM = READ_ONLY 0xC000 TO 0xFEFF;
PLACEMENT
DEFAULT_ROM INTO MY_ROM;
DEFAULT_RAM INTO MY_RAM;
END
STACKSIZE 0x600
VECTOR 0 _Startup /* set reset vector on _Startup */
VECTOR 7 _RTI_ISR //我添加的
请问我为什么出错了
编译能通过
可进不去中断
|