Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CodeVision AVR 1.25.7, user manual.pdf
Скачиваний:
214
Добавлен:
12.08.2013
Размер:
1.22 Mб
Скачать

CodeVisionAVR

3.20 Using the AVR Studio Debugger

CodeVisionAVR is designed to work in conjunction with the Atmel AVR Studio debugger version 3 and 4.06 (or later).

For the AVR Studio debugger version 4.06 (or later) the compiler will generate an extended COFF object file that allows watching structures and unions. So it is highly recommended to use AVR Studio version 4.06 (or later) instead of version 3, which doesn’t support this feature. AVR Studio 4 prior to version 4.06 does not support the extended COFF object file format, so it can’t be used with CodeVisionAVR.

In order to be able to do C source level debugging using AVR Studio, you must select the COFF output file format in the Project|Configure|C Compiler|Code Generation menu option.

The AVR Studio Debugger is invoked using the Tools|Debugger menu command or the Debugger toolbar button.

3.20.1 Using the AVR Studio Debugger version 3

The COFF object file created by the compiler will be automatically loaded after AVR Studio is invoked using the CodeVisionAVR IDE Tools|Debugger menu command or the Debugger toolbar button.

Once the program is loaded, it can be launched in execution using the Debug|Go menu command, by pressing the F5 key or by pressing the Execute program toolbar button.

Program execution can be stopped at any time using the Debug|Break menu command, by pressing Ctrl+F5 keys or by pressing the Break toolbar button.

To single step the program, the Debug|Trace Into (F11 key), Debug|Step (F10 key), Debug|Step Out menu commands or the corresponding toolbar buttons should be used.

In order to stop the program execution at a specific source line, the Breakpoints|Toggle Breakpoint menu command, the F9 key or the corresponding toolbar button should be used.

In order to watch program variables, the user must select Watch|Add Watch menu command or press the Add Watch toolbar button, and specify the name of the variable in the Watch column.

The AVR chip registers can be viewed using the View|Registers menu command or by pressing the

Alt+0 keys.

The AVR chip PC, SP, X, Y, Z registers and status flags can be viewed using the View|Processor menu command or by pressing the Alt+3 keys.

The contents of the FLASH, SRAM and EEPROM memories can be viewed using the View|New Memory View menu command or by pressing the Alt+4 keys.

The I/O registers can be viewed using the View|New IO View menu command or by pressing the

Alt+5 keys.

In order to use the Terminal I/O window, invoked with the View|Terminal I/O menu command, for communication with the simulated AVR chip’s UART, the COFF file format must be selected and the

Use the Terminal I/O in AVR Studio check box must be checked in the Project|Configure|C Compiler|Code Generation dialog.

To obtain more information about using AVR Studio please consult it’s Help system.

© 1998-2007 HP InfoTech S.R.L.

Page 108

CodeVisionAVR

3.20.2 Using the AVR Studio Debugger version 4.06 or later

The user must first select File|Open File (Ctr+O keys) in order to load the COFF file to be debugged. After the COFF file is loaded, and no AVR Studio project file exists for this COFF file, the debugger will open a Select device and debug platform dialog window.

In this window the user must specify the Debug Platform: ICE or AVR Simulator and the AVR Device type.

Pressing the Finish button will create a new AVR Studio project associated with the COFF file.

If an AVR Studio project associated with the COFF file already exists, the user will be asked if the debugger may load it.

Once the program is loaded, it can be launched in execution using the Debug|Run menu command, by pressing the F5 key or by pressing the Run toolbar button.

Program execution can be stopped at any time using the Debug|Break menu command, by pressing Ctrl+F5 keys or by pressing the Break toolbar button.

To single step the program, the Debug|Step Into (F11 key), Debug|Step Over (F10 key), Debug|Step Out (Shift+F11 keys) menu commands or the corresponding toolbar buttons should be used.

In order to stop the program execution at a specific source line, the Debug|Toggle Breakpoint menu command, the F9 key or the corresponding toolbar button should be used.

In order to watch program variables, the user must select Debug|Quickwatch (Shift+F9 keys) menu command or press the Quickwatch toolbar button, and specify the name of the variable in the QuickWatch window in the Name column.

The AVR chip registers can be viewed using the View|Register menu command or by pressing the Alt+0 keys. The registers can be also viewed in the Workspace|I/O window in the Register 0-15 and

Register 16-31 tree branches.

The AVR chip PC, SP, X, Y, Z registers and status flags can be viewed in the Workspace|I/O window in the Processor tree branch.

The contents of the FLASH, SRAM and EEPROM memories can be viewed using the View|Memory menu command or by pressing the Alt+4 keys.

The I/O registers can be viewed in the Workspace|I/O window in the I/O branch.

To obtain more information about using AVR Studio please consult it’s Help system.

© 1998-2007 HP InfoTech S.R.L.

Page 109