|
我用的是新塘官方的例程,开发工具用的是keil,在进行仿真的时候发现没有进入中断函数里面。
了解的朋友帮忙解答一下。谢谢。
程序如下:
/************************************************************************************************************
* Timer2 Capture interrupt subroutine
************************************************************************************************************/
void Capture_ISR (void) interrupt 12
{
clr_CAPF0; // clear capture0 interrupt flag
P1 = C0L; // For capture mode CxL/CxH with data capture from I/O pin
P2 = C0H;
P12 = ~P12; //toggle GPIO1 to show int
// printf("\n TM2 CAP 0x%bX",C0H);
}
/************************************************************************************************************
* Main function
************************************************************************************************************/
void main (void)
{
P00_Input_Mode;
//InitialUART0_Timer3(115200);
TIMER2_Compare_Capture_Mode;
IC3_P00_CAP0_BothEdge_Capture;
// IC6_P05_CAP1_BothEdge_Capture;
set_ET2; //Enable Timer2 interrupt
set_ECAP; //Enable Capture interrupt
set_TR2; //全局开启中断
set_EA;
set_EPI;
while(1);
} |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|