›› 2012, Vol. 25 ›› Issue (12): 103-.

• 论文 • 上一篇    下一篇

Keil C51精确延时程序设计

吴挺运,林成何   

  1. (陕西理工学院 物理与电信工程学院,陕西 汉中 723000)
  • 出版日期:2012-12-15 发布日期:2013-02-28
  • 作者简介:吴挺运(1989—),男,本科。研究方向:机电产品设计,测控,无线通信,有线通信。

Design  of a Precise Delay Program  Based on Keil C51

WU Ting-Yun, LIN Cheng-He   

  1. (School of Physics and Communication Engineering,Shaanxi University of Technology,Hanzhong 723000,China)
  • Online:2012-12-15 Published:2013-02-28

摘要:

针对C语言代码的执行时间的可预见性差,结合Keil C51开发工具,分析了在Keil C51开发工具中利用C语言实现精确的延时程序的设计,指出了常用延时方法优缺点。并通过一些实例分析了延时时间的计算方法,使C语言代码的延时时间可以被预见。C语言中嵌套汇编语言是一种有效的方法,可以充分发挥出各语言的优势特点、提高开发效率。

关键词: Keil C51, C语言, 软件延时, 单片机

Abstract:

In view of the poor predictability of the execution time of the C programming language code,we use C programming language to achieve the accurate design of delay procedure in detail,and point out the advantages and disadvantages of the usual delay methods.Besides,we take advantage of some powerful functions of Keil C51 to introduce the calculation of the delay time through some examples so that the delay time of the C programming language code can be predicted.Nesting the assembly language into C programming language can give full play to the advantages of all kinds of language and thus improving the development efficiency.

Key words: Keil C51;C language;delay by the software;MCU

中图分类号: 

  • TN912.3