推荐星级:
  • 1
  • 2
  • 3
  • 4
  • 5

对单片机C语言教材中一段程序的分析

更新时间:2020-11-18 04:15:20 大小:928K 上传用户:gsy幸运查看TA发布的资源 标签:单片机C语言 下载积分:1分 评价赚积分 (如何评价?) 打赏 收藏 评论(0) 举报

资料介绍

C语言是一种结构化的高级语言,具有代码紧凑、可移植性强、符合人的日常思维方式等特点.由于不需要深入了解单片机的指令系统和硬件结构、上手容易等特点,单片机的C语言学习和应用变得很普及.一些单片机开发者由于不了解单片机C语言和通用计算机C语言之间的区别,当涉及单片机内部硬件及端口操作,特别是在单片机的应用中经常使用的位操作等,编程时经常出现一些不易发现的错误.本文通过对一段程序的分析,从语法错误、循环变量使用、移位操作、拼写错误和算法错误等几个方面归纳了产生错误的原因并给出了解决的方法.还进一步指出了用C语言进行单片机开发需要注意的一些其它事项.上述问题在多次再版的教材中也存在,可见这类错误的普遍性和代表性,应引起单片机的C语言学习者的重视.

C language is a kind of structured high-level language,which has the characteristics of compact code,strong portability and conforming to people’s daily thinking mode.It becomes very popular to study and use C language of MCU because of not needing to know the instruction system and hardware structure of MCU and its ease of use.Because of not understanding the difference between single chip microcomputer C language and general computer C language,some MCU developers often make some programming mistakes which are not easy to find,when it comes to the internal hardware and port operation of the single chip computer,especially the bit operation which is often used in the application of the single chip computer.Through the analysis of a program,this paper sums up the causes of errors from grammatical errors,the use of cyclic variables,shift operations,spelling errors and algorithm errors,and provides some solutions.In addition,some other matters needing attention in developing C single chip microcomputer are discussed.These problems also exist in many textbooks.It can be seen that attention needs to be paid to the universality and representativeness of these errors by C language learners of MCU.

部分文件列表

文件名 大小
对单片机C语言教材中一段程序的分析.pdf 928K

全部评论(0)

暂无评论

上传资源 上传优质资源有赏金

  • 打赏
  • 30日榜单

推荐下载