#include <hidef.h> /* for EnableInterrupts macro */ #include <MC68HC908QY4.h> /* include peripheral declarations */
void Init() { CONFIG1 = 0x09; TSC_TSTOP = 1; TSC_TRST = 1; TSC = 0x46; TMODH = 0x4b; TMODL = 0x00;
DDRA = 0x10; PTA = 0x00; ADSCR = 0x21; } void delay(void){ uchar i,j; for(i=0;i<=100;i++) for(j=0;j<=100;j++); } void main(void) { EnableInterrupts; /* enable interrupts */ /* include your code here */ Init(); for(;;) { delay(); __RESET_WATCHDOG(); /* feeds the dog */ } /* loop forever */ /* please make sure that you never leave this function */ }
interrupt void SH_OverFlow_ISR(void){ // EnableInterrupts; /* enable interrupts */ TSC_TOIE = 0; TSC_TOF = 0; PTA = 0x19;
TSC_TOIE = 1;
}
我并在文件P&S_FCS_linker.prm中定义了一下中断服务函数如下:
VECTOR 6 SH_OverFlow_ISR/*tim的中断服务程序的定义*/
但是我在单步调试时就是进入不了中断服务程序.
请哪位高手给予指点. [此贴子已经被作者于2006-3-1 13:02:15编辑过]
[此贴子已经被作者于2006-3-1 16:08:08编辑过] |