智能车制作
标题:
用下面的程序实现记录高电平脉冲的时间,但一直出错,求救啊,大神们
[打印本页]
作者:
花样年华
时间:
2013-11-3 13:18
标题:
用下面的程序实现记录高电平脉冲的时间,但一直出错,求救啊,大神们
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
void main(void) {
/* put your own code here */
long int i,num;
i=0;
static void IOC_Int(void)
{
TSCR1=0x80;
TIOS=0x00;
TCTL4=0x06;
TIE=0x02;
}
#pragma CODE_SEG_NEAR_SEG_ NON_BANKED
void interrupt 9 ECT1_ISR(void)
{
TFLG1|=0x01;
for(;;)
i++;
TIE1=0X02;
}
void interrupt 8 ECTO_ISR(void)
{
num=i;
i=0;
TFLG1=0x02;
}
EnableInterrupts;
for(;;) {
_FEED_COP(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}
欢迎光临 智能车制作 (http://111.231.132.190/)
Powered by Discuz! X3.2