论文部分内容阅读
在51单片机的实际运用中,笔者采用了一种简单、有效的软件抗干扰法,较好地解决了程序“跑飞”问题。一般的单片机应用系统中,工作程序都不很长,数据区也有限。因此,可以在有用的程序及数据区之外的所有内存单元中,全部填入字节02H。这样,一旦程序飞入这些区域,也就是系统受干扰而使程序“跑飞”时,CPU 便会自动执行一条无条件转移指令LJMP0202H(机器码020202H)并在0202H 这个地址上,设置一条无条件转移指令LJMPaddress,跳转到系统正常
In the actual use of 51 single-chip microcomputer, the author adopted a simple and effective software anti-interference method, a better solution to the program “running” problem. The general SCM application system, the working procedures are not very long, the data area is limited. Therefore, byte 02H can be completely populated in all memory locations outside of the useful program and data area. In this way, once the program flies into these areas, that is, the system is disturbed and the program “ran off”, the CPU will automatically execute an unconditional branch instruction LJMP0202H (machine code 020202H) and set an unconditional branch instruction at 0202H LJMPaddress, jump to the normal system