⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 25.htm

📁 德国keil软件仿真的使用教程
💻 HTM
字号:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<base target="_self">
<meta name="Microsoft Border" content="none">
</head>

<body background="../images/asd003.jpg">
<div align="left">
  <table border="0" cellpadding="0" width="600" height="3241">
    <tr>
      <td height="71" width="594" colspan="3">
        <p style="line-height: 150%"><b><font color="#FF0000">注意:</font><font size="3" color="#008000">在进入这一步之前请务必先把经过修改的程序进行编译!因为仿真器只认识经过编译的机器语言,<a href="23.htm">点击查看编译*.ASM文件的件的方法&gt;&gt;</a>,每次修改了不满意的程序后都要先进行编译,然后在进入仿真调试环境进行仿真。</font></b></td>
    </tr>
    <tr>
      <td height="506" width="594" colspan="3">
        <img border="0" src="tu/b2.gif" width="523" height="504"></td>
    </tr>
    <tr>
      <td height="25" width="594" colspan="3">
        <p style="line-height: 150%"></td>
    </tr>
    <tr>
      <td height="33" width="594" colspan="3">
        <p align="center" style="line-height: 200%"><font color="#800000"><b>一,先来看看都有那些常用的调试命令:</b></font></p>
      </td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="403" width="248">
        <p align="left"><img border="0" src="tu/b3.gif" width="237" height="401"></td>
      <td height="403" width="28">
        &nbsp;&nbsp;&nbsp;</td>
      <td height="403" width="314">
        <img border="0" src="tu/zong.jpg" width="371" height="399"></td>
    </tr>
    <tr>
      <td height="118" width="594" colspan="3">
        <p align="center"><img border="0" src="tu/b5.gif" width="429" height="116"></td>
    </tr>
    <tr>
      <td height="50" width="594" colspan="3">
        <p style="line-height: 150%"><font color="#FF00FF">关于运行了全速运行后的注意事项:</font>如果在全速运行时你想退出debug环境,要先按压一下仿真器硬件上的复位按钮,再点击keil仿真工具条中的“停止”按钮“start/stop&nbsp;debug&nbsp;session”&nbsp;按钮就可以顺利退出了。否则keil将要等待比较久的超时退出,表现为报告无法联机。</td>
    </tr>
    <tr>
      <td height="50" width="594" colspan="3"><font size="7" color="#0000FF">1.</font>设置好相关的选项之后,点击<img border="0" src="tu/n1.gif" width="28" height="29">,就可以进入硬件仿真调试环境了。</td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td height="157" width="594" colspan="3">
        <p style="line-height: 200%"><font size="7" color="#0000FF">2.</font><img border="0" src="tu/n2.gif" width="27" height="25"><font color="#0000FF"><b>指定程序行停止</b></font>的作用是让仿真器程序运行到鼠标点击光标处,即运行到指定断点后停止,<font color="#FF00FF">这是一个最常用的也是最实用的快捷按纽,</font>它可以让我们很快找到<font color="#FF0000">有问题的程序行</font>所在位置,修改之后按一下<img border="0" src="tu/n1.gif" width="28" height="29">退出仿真调试环境,点击<img border="0" src="tu/n5.gif" width="26" height="29">把刚刚已经修改的程序编译一下,再点击<img border="0" src="tu/n1.gif" width="28" height="29">进入仿真调试环境,用<img border="0" src="tu/n2.gif" width="27" height="25">进行仿真观察结果。反复调试,直到满意为止,这样的效率是非常高的,复杂的程序也可以在短时间内完成。</td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"><font color="#800000">&nbsp;</font></td>
    </tr>
    <tr>
      <td height="64" width="594" colspan="3">
        <p style="line-height: 200%"><img border="0" src="tu/n2.gif" width="27" height="25"><font color="#0000FF"><b>指定程序行停止</b></font><font color="#FF0000"><b>实用技巧1</b>,指定点停止运行:</font><font color="#800000">下面我们用样例程序来进行一下示范,<a href="zip/lsdsmg.rar">请先点击下载样例程序&gt;&gt;</a></font></td>
    </tr>
    <tr>
      <td height="64" width="594" colspan="3">
        <p style="line-height: 200%"><font color="#FF0000">下载后,打开</font><font color="#FF0000">用其中的</font><font color="#FF00FF">liu.Uv2</font><font color="#000000">文件</font><font color="#008000">,打开后设置好仿真器的硬件参数,设置方法详见:</font><font color="#FF00FF" size="3"><a href="24.htm">KEIL硬件仿真器的</a>设置方法。</font></td>
    </tr>
    <tr>
      <td height="33" width="594" colspan="3"><font color="#FF00FF">进入后的具体操作:</font>点击<img border="0" src="tu/n1.gif" width="28" height="29">进入仿真调试环境,<font color="#FF0000">鼠标点击要运行到的程序行:</font></td>
    </tr>
    <tr>
      <td height="68" width="594" colspan="3">
        <p style="line-height: 200%">其中黄色箭头表示的是原始位置,红色箭头表示的是我们用鼠标点击后要程序启动以后停止的位置。点击一下后会看到光标在那里闪动,此时点击<img border="0" src="tu/n2.gif" width="27" height="25">就可以了</td>
    </tr>
    <tr>
      <td height="64" width="594" colspan="3">
        <p style="line-height: 200%">我们将会看到程序运行到光标闪动的地方停下来,同时仿真器驱动硬件达到同样的位置停下来!</td>
    </tr>
    <tr>
      <td height="290" width="594" colspan="3">
        <p align="center"><img border="0" src="tu/b6.gif" width="396" height="288"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td height="64" width="594" colspan="3">
        <p style="line-height: 200%"><font color="#FF0000"><a name="2"></a><img border="0" src="tu/n2.gif" width="27" height="25"></font><font color="#0000FF"><b>指定程序行停止</b></font><font color="#FF0000"><b>实用技巧2</b>,让全部程序在目标板上跑一遍。</font><font color="#FF00FF">相当于用编程器烧写到芯片里面,再插到试验板看实际效果的作用:</font></td>
    </tr>
    <tr>
      <td height="45" width="594" colspan="3"><b><font size="3" color="#000000"><img border="0" src="../images/niu/jing1.gif" width="15" height="15"></font></b>操作的讲解还是参看上个图,如果我们用鼠标点击黄色箭头处,让它在第一行<font color="#FF00FF">CLR  
        P2.0</font>处闪动。此时点击<font color="#FF0000"><img border="0" src="tu/n2.gif" width="27" height="25">,就会看到仿真器硬件上把全部程序跑一遍的实际效果了。</font></td>
    </tr>
    <tr>
      <td height="64" width="594" colspan="3">
        <p style="line-height: 200%"><font size="4" color="#0000FF"><b>注意:</b></font>如果我们把指定停止地点放在程序的第一行(标号LOOP下面的是第一行)<font color="#FF0000">的话,除了让程序运行一个循环之外,还相当于给整个程序复位。</font></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td height="50" width="594" colspan="3"><font size="7" color="#0000FF">3.</font><img border="0" src="tu/n3.gif" width="25" height="27"><font color="#0000FF">单步运行</font>作用是每点击<img border="0" src="tu/n3.gif" width="25" height="27">一次程序执行一行,同时驱动硬件作相应动作。</td>
    </tr>
    <tr>
      <td height="33" width="594" colspan="3">
        <p style="line-height: 200%">它就是单步执行的作用,可以把仿真调试具体到某一行程序的运行。</td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td height="50" width="594" colspan="3"><font size="7" color="#0000FF">4.</font><img border="0" src="tu/n6.gif" width="24" height="29"><font color="#0000FF">跟踪程序运行顺序</font>,经过上面的实践之后大家可以很快理解它的作用了。</td>
    </tr>
    <tr>
      <td height="95" width="594" colspan="3">
        <p style="line-height: 200%">它的作用是<font color="#0000FF">跟踪程序运行顺序</font>,它的特殊之处是遇到有转移指令等特殊指令的时候,它会直接跳到目标转移子程序处,比如跳到延时子程序开始点。它也可以跟踪中断等。总之就是让我们知道程序到底在做什么!找出程序真正的运行轨迹!</td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td height="48" width="594" colspan="3">5.<img border="0" src="tu/n4.gif" width="24" height="29"><font color="#0000FF">仿真器CPU复位按纽,它只是让仿真器的中央处理器回到初始状态,不能让整系统全部复位。要全部仿真器系统复位请用</font><font color="#FF00FF"><a href="#2">上面介绍过的</a></font><a href="#2"><font color="#FF0000"><img border="0" src="tu/n2.gif" width="27" height="25"></font><font color="#0000FF">指定断点</font><font color="#FF0000">的实用技巧2</font></a></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3">&nbsp; </td>
    </tr>
    <tr>
      <td height="219" width="594" colspan="3">
        <p style="line-height: 200%"><font size="7" color="#0000FF">6.</font><img border="0" src="tu/b4.jpg" width="25" height="29"><font color="#FF0000">一个不要经常使用的终极按纽</font>,它是全速运行最终程序的快捷按纽,它的作用是将已经没有问题的全部程序写入仿真器芯片,让它全速运行,此时仿真器将不再受到KEIL的控制,也就是断开了和KEIL的联系,作用和编程器类似。运行它之后要按动一下,仿真器上的硬件复位按钮同时点击<img border="0" src="tu/n1.gif" width="28" height="29">退出仿真环境,再次点击<img border="0" src="tu/n1.gif" width="28" height="29">才能重新进入仿真环境进行仿真。请慎用此按钮,因为它会断开仿真器和KEIL的通讯联系。<font color="#FF00FF"><a href="#2">用上面介绍过的</a></font><a href="#2"><font color="#FF0000"><img border="0" src="tu/n2.gif" width="27" height="25"></font><font color="#0000FF">指定断点</font><font color="#FF0000">的实用技巧2</font></a><font color="#FF0000">同样可以达到同样的效果,同时不会</font>断开仿真器和KEIL的通讯<font color="#FF0000">。</font></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"><font color="#800000">&nbsp;</font></td>
    </tr>
    <tr>
      <td height="64" width="594" colspan="3">
        <p style="line-height: 200%"><font color="#800000">先就说这些吧,还有很多高级应用没有时间一一详细说明,望大家能够理解!也希望大家多看书,多研究,多摸索。</font></p>
      </td>
    </tr>
    <tr>
      <td height="33" width="594" colspan="3">
        <p style="line-height: 200%"><b><font color="#008000">最后,祝大家短时间内就可以提高编程效率,早日成为单片机程序开发高手。</font></b></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
    <tr>
      <td height="18" width="594" colspan="3"></td>
    </tr>
  </table>
</div>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -