📄 ——单片机系统在测控领域的稳定性探讨.htm
字号:
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">非</SPAN><SPAN
lang=EN-US>EPROM</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">地址选通信号</SPAN></P></DIV></TD></TR></TBODY></TABLE></v:textbox></v:shape></v:group><SPAN
lang=EN-US> <IMG
src="——单片机系统在测控领域的稳定性探讨.files/picrad254DB.gif"></SPAN><BR
style="mso-ignore: vglayout" clear=all></P>
<P class=MsoNormal
style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们也可通过硬件的方法用一个缓冲器直接给数据线写一个值,其原理与上述方法相同。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 36.75pt; TEXT-INDENT: -21pt; mso-list: l1 level2 lfo2"><B><SPAN
lang=EN-US
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">三、<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></B><B><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件看门狗技术</SPAN><SPAN
lang=EN-US><o:p></o:p></SPAN></B></P>
<P class=MsoNormal
style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们知道看门狗的作用就是防止程序发生死循环,或者说程序跑飞。硬件看门狗是利用了一个定时器,来监控主程序的运行,也就是说在主程序的运行过程中,我们要在定时时间到之前对定时器进行复位如果出现死循环,或者说</SPAN><SPAN
lang=EN-US>PC</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指针不能回来。那么定时时间到后就会使单片机复位。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 15.75pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5; mso-char-indent-size: 10.5pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件看门狗技术的原理和这差不多,只不过是用软件的方法实现,我们还是以</SPAN><SPAN
lang=EN-US>51</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">系列来讲,我们知道在</SPAN><SPAN
lang=EN-US>51</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">单片机中有两个定时器,我们就可以用这两个定时器来对主程序的运行进行监控。我们可以对</SPAN><SPAN
lang=EN-US>T0</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设定一定的定时时间,当产生定时中断的时候对一个变量进行赋值,而这个变量在主程序运行的开始已经有了一个初值,在这里我们要设定的定时值要小于主程序的运行时间,这样在主程序的尾部对变量的值进行判断,如果值发生了预期的变化,就说明</SPAN><SPAN
lang=EN-US>T0</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中断正常,如果没有发生变化则使程序复位。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 15.75pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5; mso-char-indent-size: 10.5pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于</SPAN><SPAN
lang=EN-US>T1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们用来监控主程序的运行,我们给</SPAN><SPAN
lang=EN-US>T1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设定一定的定时时间,在主程序中对其进行复位,如果不能在一定的时间里对其进行复位,</SPAN><SPAN
lang=EN-US>T1 </SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的定时中断就会使单片机复位。在这里</SPAN><SPAN
lang=EN-US>T1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的定时时间要设的大于主程序的运行时间,给主程序留有一定的的裕量。而</SPAN><SPAN
lang=EN-US>T1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的中断正常与否我们再由</SPAN><SPAN
lang=EN-US>T0</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定时中断子程序来监视。这样就够成了一个循环,</SPAN><SPAN
lang=EN-US>T0</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">监视</SPAN><SPAN
lang=EN-US>T1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,</SPAN><SPAN
lang=EN-US>T1</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">监视主程序,主程序又来监视</SPAN><SPAN
lang=EN-US>T0</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,从而保证系统的稳定运行。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 15.75pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5; mso-char-indent-size: 10.5pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作者联系:
<A
href="mailto:zc_wang765@sina.com">zc_wang765@sina.com</A></SPAN></P>
<P></P></DIV></TD></TR>
<TR>
<TD align=middle height=15>
<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>
<DIV></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=right height=2>
<TABLE cellSpacing=0 cellPadding=0 width="80%" border=0>
<TBODY>
<TR>
<TD width=75>【<A href="javascript:doPrint();">打印本稿</A>】</TD>
<TD width=8></TD>
<TD width=75>
<P>【<A
href="http://www.21ic.com/new_info/news/review.asp?title=单片机系统在测控领域的稳定性探讨target="
_blank?>发表评论</A>】</P></TD>
<TD width=10></TD>
<TD width=79>【<A
href="http://www.21ic.com/new_info/news/sendmail.asp?num=单片机系统在测控领域的稳定性探讨">推荐</A>】</TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=right height=2></TD></TR>
<TR>
<TD align=right height=2><A href="javascript:window.close();"><IMG
height=20 src="——单片机系统在测控领域的稳定性探讨.files/close_c.gif" width=77
border=0 name=Image161></A><FONT
color=#ffffff>----</FONT></TD></TR></TBODY></TABLE><BR><BR>
<TABLE cellSpacing=0 cellPadding=0 width=520 align=center border=0>
<TBODY>
<TR>
<TD vAlign=bottom align=middle width=114 bgColor=#999a76
height=1><IMG height=1 src="——单片机系统在测控领域的稳定性探讨.files/blank.gif"
width=1></TD>
<TD width=466 height=1></TD></TR>
<TR>
<TD align=middle width=114 bgColor=#ece8db height=19>相关新闻</TD>
<TD width=466 height=19></TD></TR>
<TR bgColor=#999a76>
<TD colSpan=2 height=1><IMG height=1
src="——单片机系统在测控领域的稳定性探讨.files/blank.gif" width=1></TD></TR>
<TR>
<TD colSpan=2 height=1></TD></TR></TBODY></TABLE>
<TABLE borderColor=#000000 cellSpacing=0 cellPadding=0 width=520
align=center border=0>
<TBODY>
<TR>
<TD vAlign=top>
<TABLE class=RelatedTable width="100%" border=0>
<TBODY>
<TR class=RelatedTr>
<TD class=RelatedTd>
<SCRIPT language=javascript
src="——单片机系统在测控领域的稳定性探讨.files/about.htm"></SCRIPT>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR></TD>
<TD vAlign=top align=middle width=150 bgColor=#ece8db height=2>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TBODY>
<TR>
<TD bgColor=#000000>
<TABLE cellSpacing=0 cellPadding=2 width=150 bgColor=#ece8db
border=0>
<TBODY>
<TR>
<TD>
<META content="Microsoft FrontPage 5.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId><BR><A
href="http://www.hhcn.com/chinese/cnindex.html"
target=blank>华恒<BR>(ARM,PowerPC,冷火,龙珠)</A><BR><A
href="http://www.embedon.com/" target=blank>远峰</A> <BR><A
href="http://www.21ic.com/custom/jhb/index.htm"
target=blank>复旦金海博</A><BR><A
href="http://www.emdoor.com/index.asp"
target=blank>亿道</A><BR><BR>单片机 <BR><BR><A
href="http://www.hk.renesas.com/"
target=blank>Renesas</A><BR><A
href="http://www.zlgmcu.com/tools/kaifaban.asp"
target=blank>周立功 Philips</A> <BR><A
href="http://www.strong-ic.com/" target=blank>胜创特</A> <BR><A
href="http://www.holtek.com.tw/" target=blank>盛群 Holtek</A>
<BR><A href="http://www.xhl.com.cn/"
target=blank>Cygnal单片机</A><BR><A href="http://www.lierda.com/"
target=blank>利尔达MSP430</A> <BR><BR>接口电路:<BR><BR><A
href="http://www.whjmw.com/" target=blank>金迈威</A> <BR><A
href="http://www.21ic.com/custom/maiwei/mw.htm"
target=blank>迈威</A> <BR><A href="http://www.rs232.net.cn/"
target=blank>瑞赛特</A><BR><BR><BR>存储器<BR><A
href="http://www.huazhoucn.com/"
target=blank>铁电存储器免费样品</A><BR><BR><BR>模拟器件<BR><A
href="http://www.unique-ap.com.cn/"
target=blank>Linear</A><BR><BR><BR>编程器<BR><A
href="http://www.xeltek.com.cn/"
target=blank>西尔特编程器</A><BR></TD></TR>
<TR>
<TD
height=5></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=766 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top colSpan=6></TD></TR>
<TR>
<TD vAlign=top colSpan=6 height=10></TD></TR>
<TR>
<TD vAlign=top bgColor=#999999 colSpan=6 height=2></TD></TR>
<TR>
<TD class=stxt vAlign=center align=middle colSpan=6
height=6></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=766 align=center border=0>
<TBODY>
<TR>
<TD class=s width=973 height=12></TD></TR>
<TR>
<TD class=s width=973 height=20>
<DIV align=center><FONT face="Arial, Helvetica, sans-serif"><!--start copyright-->
<DIV align=center><FONT color=black>
<TABLE cellSpacing=0 cellPadding=0 width=600 align=center border=0>
<TBODY>
<TR>
<TD align=middle width="100%" colSpan=2><BR>Better View:800*600 Best
View:1024x768 为了本系统能够更好的为您服务,请使用IE4.0或以上版本浏览器
<BR><BR>版权所有(C)21IC中国电子网 电话:010-82357510, 82357511 传真: 010-82357512
</TD></TR></TBODY></TABLE><!--start copyright--></FONT></DIV></FONT></DIV></TD></TR></TBODY></TABLE><BR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -