导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→[求助]请高手帮忙修改程序[leihsu]

 *第25147篇: [求助]请高手帮忙修改程序

  
楼 主:leihsu 2004年8月28日10:54
 [求助]请高手帮忙修改程序
题目如下:用ATMEL89c51单片机制作一个转速测量系统,用c语言编写源程序,测量周期,角频率,转速,任选一个。并且用Protel画出印制版电路图。
园盘上面有小孔,可以根据小孔来测量转速,角频率,或者周期,等等。

以下是同学写的程序,小弟单片机知识匮乏,又崔得比较急,请高手帮忙修改,跟同学的有所区别,能应付交差就行。不胜感激!(希望在关键步骤后稍加注释,谢谢了)

# include   < reg52.h>  
 typedef unsigned char byte
 byte count.low
byte count.high
int count_value
 void clock0_initial ( ) reentrant using 0
{ TCON=0X00;
   TH0=0X00;
   TL0=0X00;
   TR0=1;
}
 void count_module (byte a )
{do
{ count_high=TH0;RESETCS=1;
} while (count_high!=TH0);
 }
   Void main ()
{ TMOD=0x05;
  clock0_initial ( );
  ET0=1;
  EA=1;
  do { count_module (1); } P1=CNT=>  8;P2=CNT;
while (1); }
  void clk_int(void) interrupt 1 using 0
  { count_value=count_value+1;
    clock1_initial (1);
   }

  
2楼:guest 2004年8月28日16:49
 # include < reg52.h>
# include   < reg52.h>  
 typedef unsigned char byte
 byte count.low
byte count.high
int count_value
 void clock0_initial ( ) reentrant using 0
{ TCON=0X00;
   TH0=0X00;
   TL0=0X00;
   TR0=1;
}
 void count_module (byte a )
{do
{ count_high=TH0;count_low=tl0;RESETCS=1;
} while (count_high!=TH0);
 }
   Void main ()
{ TMOD=0x05;
  clock0_initial ( );
  ET0=1;
  EA=1;
  do { count_module (1); } P1=CNT=>  8;P2=CNT;
while (1); }
  void clk_int(void) interrupt 1 using 0
  { count_value=count_value+1;
    clock1_initial (1);
   }


>>>>>>对该主题发表你的看法

本主题贴数2,分页: [第1页]


[上一篇主题]:恒丰锐科三星ARM7开发板元件焊接示意图

[下一篇主题]:[求助]关于MSP430的学习问题求教高手指点!