AVR Studio Debugging Quick Start

Publisher:浅唱清风Latest update time:2015-02-02 Source: laoguKeywords:AVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The following debugging methods are from AVR Studio 4. I have tried to translate them for accurate understanding. Please correct me if there are any inaccuracies:

Auto Step Automatic execution

It can repeat the instructions. If the current mode is source (i.e. C language window display mode), one instruction will be executed. If the disassembly mode is processed (i.e. display as assembly instruction mode), one assembly instruction will be executed. After each instruction is executed, all the information in the window will be updated. The

execution delay of each instruction can be selected in debug option.

When the user presses stop or there is a breakpoint, the automatic execution will stop.

Step Into Single-step execution:

only one instruction is executed. If the current mode is source (i.e. C language window display mode), one instruction will be executed. If the disassembly mode is processed (i.e. display as assembly instruction mode), one assembly instruction will be executed.

After each instruction is executed, all the information in the window will be updated.

Step Over

Only one instruction is executed. If this instruction contains or calls a function or subroutine, this function or subroutine will also be executed. If there is a breakpoint, the execution will stop. After the execution is completed, the information will be displayed in the window.

Step Out

Step Out will execute until the current program ends. If there is a breakpoint, the execution will stop. When the step out action is executed at the beginning of the program, the program will execute until the end, unless there is a breakpoint or the user manually interrupts it.

After the run is completed, all the information will be displayed in the window.

Run to Cursor Execute to the cursor position

Execute to the position where the cursor is placed in the source window (i.e., the C language window). Even if there is a breakpoint, it will not be interrupted. If the position where the cursor is located cannot be executed, the program will continue to execute until the user manually interrupts it. After the execution is completed, all the information will be

displayed in the window. Because this method depends on the position of the cursor, it can only be used in the source, i.e., C language window mode.


--------------------------------------------------------------------------------

QuickWatch: When the program is simulated, the values ​​of some ports or variables are immediately displayed.

Operation method: For example, we want to see the value of i in operation. Select i in the C source code, a pop-up menu will pop up, select: Add to Watch: i (or you can select i and press the quickwatch button marked with a red box in the figure below).


Use a similar method to add PORTB to watch... Execute AutoStep or Step Into to display the values ​​of these two variables while the program is running!


Keywords:AVR Reference address:AVR Studio Debugging Quick Start

Previous article:Learning AVR (10) Reset and interrupt handling
Next article:Study AVR (VI) CPU Status Register

Recommended ReadingLatest update time:2024-11-23 08:13

AVR MCU fuse and unlock
The fuse configuration of AVR microcontrollers is a place where AVR microcontroller beginners can easily make mistakes. In fact, as long as you pay attention to some matters, you can try to avoid the microcontroller from being locked. Even if the microcontroller is locked, you can use some methods to unlock it. This a
[Microcontroller]
AVR MCU fuse and unlock
Digi-Key, Seeed Studio and Machinechat jointly launch industry-specific solutions
Digi-Key, Seeed Studio and Machinechat jointly launch the industry's first self-use LoRaWAN-in-a-Box solution Digi-Key Electronics, the global distributor of the broadest and fastest-stock electronic components, has teamed up with Seeed Studio and Machinechat to offer the industry’s first self-use LoRaWAN-in-a-Box s
[Internet of Things]
Digi-Key, Seeed Studio and Machinechat jointly launch industry-specific solutions
IAR for AVR Study Notes (4) --Flash Operation
Specific operation methods of common types of FLASH 4.1. FLASH area data storage. Use the keyword __flash to control storage. The effect is the same whether the __flash keyword is written before or after the data type __flash unsigned char a; //Define a variable and store it in the flash space unsigned char __flash
[Microcontroller]
Using AVR pure software to simulate electronic clock
*      Purpose : Pure software simulation of electronic clock* *      Function : realize the function of clock * Clock frequency: internal 4M * * Compilation environment: ICC-AVR7 * *See the previous log* #include iom16v.h #include macros.h #define uint unsigned int #define uchar unsigned char #define on_13
[Microcontroller]
AVR MCU Mega16 timer experiment report
1. Experimental purpose Through experiments, master the use of timers, especially the use of timer interrupts! 2. Experimental content     1 Use the timer0 of the Mega16 microcontroller to generate a 1ms interval timer interrupt (it is recommended to use the application builder, which can use both the Normal working
[Microcontroller]
AVR MCU Mega16 timer experiment report
Some suggestions on using AVR microcontroller for AD conversion
Here are some suggestions based on my own development experience: The AD conversion time should be greater than 64us (determined by pre-scaling). If the sampling hold time is short, the acquisition result may be inaccurate. The sampling voltage source should be kept as stable as possible; (that is, the sampling an
[Microcontroller]
How to solve the problem of power-on reset confusion in AVR microcontrollers
In the application of single-chip microcomputer, it is often necessary to save the running data when the power is off (including manual shutdown and accidental external power failure). At present, the common method is to add a larger capacitor (generally more than 2000 μf, and some are in the farad level) to the singl
[Microcontroller]
How to solve the problem of power-on reset confusion in AVR microcontrollers
Design of automatic tuning system based on FPGA and AVR microcontroller
1 Introduction The transmitter is one of the important equipment for wireless communication, and is widely used in the fields of radio and television, mobile communications, marine transportation, and national defense. Automatic control technology is playing an increasingly important role in the field of wireless comm
[Microcontroller]
Design of automatic tuning system based on FPGA and AVR microcontroller
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号