网站大量收购独家精品文档,联系QQ:2885784924

c语言在单片机中的应用(Application of C language in single chip microcomputer).doc

c语言在单片机中的应用(Application of C language in single chip microcomputer).doc

  1. 1、本文档共8页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
c语言在单片机中的应用(Application of C language in single chip microcomputer)

c语言在单片机中的应用(Application of C language in single chip microcomputer) C language in the development of single-chip application time: 2011-05-21 22:30:57 source: the author: in the development and application of SCM, has gradually begun to introduce high-level language, C is one of them. For those who are used to the compilation, they always feel that the high-level language controllability is not good, so it is better than the assembly. But as long as we master a certain C language knowledge, some things still easy to do, the following is the author of several problems encountered in practical work, I hope for beginners C51 who will help. First, the preparation of C51 hot boot code For industrial control computers, there is usually a watchdog circuit that acts as a watchdog and resets the computer, which is called hot start. Thermal startup is generally not allowed to start from scratch, which will cause the existing measured or calculated values to reset, resulting in system work anomalies. As a result, when the program must judge whether it is hot or cold start, the usual method is to identify a memory unit as a flag bit (such as 0x7F bits and 0x7e bits), When you start, you read the contents of the memory cell first, and if it is equal to a particular value (for example, two memory cells are 0XAA), it is considered a hot boot, It is a cold start, the execution of the program initialization part, and 0XAA to the two memory unit. According to the above design idea, when programming, set a pointer, so that it points to a specific memory unit, such as 0x7F, and then in the program to determine the procedures as follows: Void, main () {char, data, *HotPoint= (char *) 0x7f; If ((*HotPoint==0xaa) (* (--HotPoint) ==0xaa)) {/ * hot start processing } Else {HotPoint=0x7e; / * cold start point *HotPoint=0xaa; * (++HotPoint) =0xaa; } Normal working code * / / * } However, the actual debugging found that, whether it is hot start or cold start, after the boot, all memory units

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档