单片机编程软件一点通,IAR单片机编程软件工程调试方法

单片机编程软件通常以Keil和IAR为主,大家在选择适合自己的单片机编程软件时可依据工程要求而定。本文内容针对IAR单片机编程软件,主要讲解该单片机编程软件的工程调试使用方法。如果你对本文将要讲解的内容存在疑惑,不妨一起来学习下哦。

一、 打开工程

运行iar软件,进入demoled\Project目录选project.eww进行打开;

二、调试

1、设置断点

在代码左边点击要设置断点的语句,或点击要设置断点的语句,按鼠标右键,选择Toggle Breakpoint (Code)。这时该语句上将出现红色的断点标记。如下图;

·下载运行

按Ctrl+D 或主菜单Projcet-->DownLoad and Debug下载运行

·执行到断点

按F5 键或工具条上的Go 按钮都可以让程序执行到断点。Debug Log 窗口将显示关于断点的信息。

·清除断点

双击Breakpoint 窗口中带勾的方框,可以允许或禁止断点。用主菜单Edit > Toggle Breakpoint 或按鼠标右键选择Toggle Breakpoint,可以直接从Breakpoint 窗口删除该断点。

·调试执行

(1) 单步执行Step Over:按F10,主菜单Debug > Step Over, 单步执行一条C语句或汇编指令,不跟踪进入C函数或者汇编语言子程序;

(2) 单步执行Step Into:按F11,主菜单Debug > Step Into, 跟踪执行一条C语句或汇编指令,跟踪进入C函数或者汇编语言子程序

(3) Step Out:按Shift+F11 主菜单Debug >Step Out,启动C函数或汇编语言子程序从当前位置开始执行,并返回到调用该函数或子程序的下一语句

(4) Next Statement:直接运行到下一条语句

(5)Run to Cursor:从当前位置运行到光标指定处

(6)Break:终止运行

(7)Reset:复位

(8)Stop Debugging:退出调试器

查看变量(Live Watch 窗口)

(1)打开Live Watch 窗口的方法是选择主菜单View → Live Watch 命令。Live Watch 窗口用于观察静止位置上的变量,如全局变量。

(2)右键要查看的变量,点击Add to Watch;变量的值在执行时会变化并显示出来。

7、监视寄存器

选择主菜单View > Register 打开寄存器窗口,显示的是CPU 寄存器。可以从寄存器窗口左上方的下拉菜单中选择需要查看的任何寄存器组。

http://www.wu0553.com/news/36747.html
http://www.wu0553.com/news/36749.html
http://www.wu0553.com/news/36750.html
http://www.wu0553.com/news/36751.html
http://www.wu0553.com/news/36752.html
http://www.wu0553.com/news/36754.html
http://www.wu0553.com/news/36755.html
http://www.wu0553.com/news/36756.html
http://www.wu0553.com/news/36757.html
http://www.wu0553.com/news/36760.html
http://www.wu0553.com/news/36761.html
http://www.wu0553.com/news/36762.html
http://www.wu0553.com/news/36763.html
http://www.wu0553.com/news/36764.html
http://www.wu0553.com/news/36765.html
http://www.wu0553.com/news/36767.html
http://www.wu0553.com/news/36768.html
http://www.wu0553.com/news/36769.html
http://www.wu0553.com/news/36771.html
http://www.wu0553.com/news/36772.html
http://www.wu0553.com/news/36773.html
http://www.wu0553.com/news/36774.html
http://www.wu0553.com/news/36775.html
http://www.wu0553.com/news/36776.html
http://www.wu0553.com/news/36777.html
http://www.wu0553.com/news/36778.html
http://www.wu0553.com/news/36780.html
http://www.wu0553.com/news/36781.html
http://www.wu0553.com/news/36414.html
http://www.wu0553.com/news/36412.html
http://www.wu0553.com/news/36410.html
http://www.wu0553.com/news/36409.html
http://www.wu0553.com/news/36408.html
http://www.wu0553.com/news/36782.html
http://www.wu0553.com/news/36784.html
http://www.wu0553.com/news/36785.html
http://www.wu0553.com/news/36786.html
http://www.wu0553.com/news/36788.html
http://www.wu0553.com/news/36789.html
http://www.wu0553.com/news/36790.html
http://www.wu0553.com/news/36791.html
http://www.wu0553.com/news/36792.html
http://www.wu0553.com/news/36793.html
http://www.wu0553.com/news/36794.html
http://www.wu0553.com/news/36795.html
http://www.wu0553.com/news/36796.html
http://www.wu0553.com/news/36797.html
http://www.wu0553.com/news/36798.html
http://www.wu0553.com/news/36799.html
http://www.wu0553.com/news/36802.html
http://www.wu0553.com/news/36803.html
http://www.wu0553.com/news/36805.html
http://www.wu0553.com/news/36806.html
http://www.wu0553.com/news/36807.html
http://www.wu0553.com/news/36808.html
http://www.wu0553.com/news/36809.html
http://www.wu0553.com/news/36810.html
http://www.wu0553.com/news/36811.html
http://www.wu0553.com/news/36812.html
http://www.wu0553.com/news/36813.html
http://www.wu0553.com/news/36815.html
http://www.wu0553.com/news/36817.html
http://www.wu0553.com/news/36818.html
http://www.wu0553.com/news/36819.html
http://www.wu0553.com/news/36820.html
http://www.wu0553.com/news/36821.html
http://www.wu0553.com/news/36822.html
http://www.wu0553.com/news/36823.html
http://www.wu0553.com/news/36824.html
http://www.wu0553.com/news/36825.html
http://www.wu0553.com/news/36827.html
http://www.wu0553.com/news/36828.html
http://www.wu0553.com/news/36830.html
http://www.wu0553.com/news/36831.html
http://www.wu0553.com/news/36832.html
http://www.wu0553.com/news/36833.html
http://www.wu0553.com/news/36834.html
http://www.wu0553.com/news/36835.html
http://www.wu0553.com/news/36836.html
http://www.wu0553.com/news/36837.html
http://www.wu0553.com/news/36838.html
http://www.wu0553.com/news/36839.html
http://www.wu0553.com/news/36840.html
http://www.wu0553.com/news/36841.html
http://www.wu0553.com/news/36842.html
http://www.wu0553.com/news/36843.html
http://www.wu0553.com/news/36845.html
http://www.wu0553.com/news/36846.html
http://www.wu0553.com/news/36847.html
http://www.wu0553.com/news/36848.html
http://www.wu0553.com/news/36849.html
http://www.wu0553.com/news/36850.html
http://www.wu0553.com/news/36852.html

8、查看存储器

用户可以在存储器窗口监视所选择的存储器区域。

(1)选择主菜单View >Memory 打开存储器窗口(用8-bit 显示数据)。

(2)双击某个全局变量名并用鼠标将其拖到存储器窗口。执行单步,同时观察存储器的内容是如何修改的。用户可以在存储器窗口修改存储单元的内

你可能感兴趣的