做了个PH0口中断程序,可是进不了中断。请高人指点一下啊。 程序如下: #include <hidef.h> /* common defines and macros */ #include <mc9s12dg128.h> /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12dg128b"
void PORTHInit(void) { DDRH = 0XFE; //PORTH0输入 PPSH = 0X80; // 上升沿触发中断 PIEH = 0X01; //中断允许 } #pragma CODE_SEG __NEAR_SEG NON_BANKED void interrupt 6 PORTH_isr(void){ //DisableInterrupts; PIEH = 0X00; //禁止再次产生中断 PIFH = 0X01; //清中断标志位 PORTB = 0xFF; } #pragma CODE_SEG DEFAULT void main(void) { PORTHInit(); EnableInterrupts; DDRB = 0xFF; PORTB = 0x00; for(;;); }
|