No.55723 作者:天水 邮件:gchao3325@sina.com ID:21008 登陆:2次 文章数:11篇 最后登陆IP:202.194.20.48 最后登陆:2004/6/4 10:56:48 注册:2004/5/9 20:11:55 财富:144 发帖时间:2004/5/31 17:24:55 发贴者IP:218.108.46.75 标题:天水:timer0() interrupt 1 using 1? 摘要:No.55723timer0() interrupt 1 using 1? timer0() interrupt 1 using 1 { TH0=0x3C; TL0=0xB0; Dtime=Dtime-1; if(Dtime==0) { FLAG1=1; } } 这个函数timer0() interrupt 1 using 1是什么意思? 使用这个自函数的完成代码如下,但是不知道为什么TXD并没有正常输出,请高手帮忙看看我的程序。 #include <reg51.h> #define uint unsigned int #define uchar unsigned char unsigned char bdata FLAG; sbit FLAG1=FLAG^1; sbit FLAG2=FLAG^2; sbit P1_1=P1^1; unsigned char data time,Dtime,Btime; unsigned int fetch_rate(void); void main(void) { char bdata JFLAG; unsigned int data state,Astate,Bstate,rate; while(1) { P1=0xFF; FLAG=P1; TXD=0; JFLAG=FLAG> > 6; JFLAG&=0x03; switch(JFLAG) { case 0: time=2; Dtime=20; break; case 1: time=4; Dtime=40; break; case 2: time=6; Dtime=60; break; case 3: time=8; Dtime=80; break; } Btime=Dtime; ......
>>返回讨论的主题
|