ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 2200
Скачиваний: 0
CodeVisionAVR
2.1.7 Printing a File
You can print the current file using the File|Print menu command or by pressing the Print button on the toolbar.
The contents of the file will be printed to the Windows default printer.
The paper margins used when printing can be set using the File|Page Setup menu command, which opens the Page Setup dialog window.
The units used when setting the paper margins are specified using the Units list box. The printer can be configured by pressing the Printer button in this dialog window.
Changes can be saved, respectively canceled, using the OK, respectively Cancel buttons.
© 1998-2007 HP InfoTech S.R.L. |
Page 13 |
CodeVisionAVR
2.1.8 Closing a File
You can quit editing the current file by using the File|Close menu command.
If the file was modified, and wasn’t saved yet, you will be prompted if you want to do that.
Pressing Yes will save changes and close the file.
Pressing No will close the file without saving the changes.
Pressing Cancel will disable the file closing process.
All currently opened files can be closed using the File|Close All menu command.
© 1998-2007 HP InfoTech S.R.L. |
Page 14 |
CodeVisionAVR
2.1.9 Using the Navigator
The Navigator window allows easy displaying or opening of source files.
By clicking on the file name the appropriate file is maximized or opened.
After a Compile or Make process there is also displayed a list of #include –ed files, global variables and functions declared in each compiled C source file.
By clicking on the variable’s, respective function’s, name the variable, respective function, declaration is highlighted in the appropriate C source file.
If during compilation there are errors or warnings, these are also displayed in the Navigator window. By clicking on the error or warning, the corresponding source line is highlighted in the appropriate file.
The Navigator tree branches can be expanded, respectively collapsed, by clicking on the +, respectively -, buttons.
By right clicking in the Navigator window you can open a pop-up menu with the following choices:
•Open a file
•Save the currently edited file
•Save All opened files
•Close Current File
•Close Project
•Close All opened files
•Toggle on or off expanding the file branches
•Toggle on or off expanding the Errors and Warnings branches for the file whose Editor window has focus.
© 1998-2007 HP InfoTech S.R.L. |
Page 15 |
CodeVisionAVR
2.1.10 Using Code Templates
The Code Templates window allows easy adding most often used code sequences to the currently edited file.
This is achieved by clicking on the desired code sequence in the Code Templates window and then dragging and dropping it to the appropriate position in the Editor window.
New code templates can be added to the list by dragging and dropping a text selection from the Editor window to the Code Templates window.
By right clicking in the Code Templates window you can open a pop-up menu with the following choices:
•Copy to the Edit Window the currently selected code template
•Paste a text fragment from the clipboard to the Code Templates window
•Move Up in the list the currently selected code template
•Move Down in the list the currently selected code template
•Delete the currently selected code template from the list.
© 1998-2007 HP InfoTech S.R.L. |
Page 16 |
CodeVisionAVR
2.1.11 Using Clipboard History
The Clipboard History window allows viewing and accessing text fragments that were recently copied to the clipboard.
By right clicking in the Clipboard History window you can open a pop-up menu with the following choices:
•Copy to the Edit Window the currently selected text fragment from the Clipboard History window
•Delete the currently selected text fragment from the list
•Delete All the text fragments from the list.
© 1998-2007 HP InfoTech S.R.L. |
Page 17 |
CodeVisionAVR
2.2 Working with Projects
The Project groups the source file(s) and compiler settings that you use for building a particular program.
2.2.1 Creating a New Project
You can create a new Project using the File|New menu command or by pressing the Create new file button on the toolbar.
A dialog box appears, in which you must select File Type|Project and press the OK button.
A dialog will open asking you to confirm if you would like to use the CodeWizardAVR to create the new project.
If you select No then the Create New Project dialog window will open.
© 1998-2007 HP InfoTech S.R.L. |
Page 18 |
CodeVisionAVR
You must specify the new Project file name and its location.
The Project file will have the .prj extension.
You can configure the Project by using the Project|Configure menu command.
© 1998-2007 HP InfoTech S.R.L. |
Page 19 |
CodeVisionAVR
2.2.2 Opening an Existing Project
You can open an existing Project file using the File|Open menu command or by pressing the Open file button on the toolbar.
An Open dialog window appears.
You must select the file name of the Project you wish to open.
By pressing the Open button you will open the Project file and its source file(s). You can configure the Project by using the Project|Configure menu command.
© 1998-2007 HP InfoTech S.R.L. |
Page 20 |
CodeVisionAVR
2.2.3 Adding Notes or Comments to the Project
With every Project the CodeVisionAVR IDE creates a text file where you can place notes and comments.
You can access this file using the Project|Notes or Windows menu commands.
This file can be edited using the standard Editor commands.
The file is automatically saved when you Close the Project or Quit the CodeVisionAVR program.
© 1998-2007 HP InfoTech S.R.L. |
Page 21 |
CodeVisionAVR
2.2.4 Configuring the Project
The Project can be configured using the Project|Configure menu command or the Project Configure toolbar button.
2.2.4.1 Adding or removing a File from the Project
To add or remove a file from the currently opened project you must use the Project|Configure menu command.
A Configure Project tabbed dialog window will open. You must select the Files tab.
By pressing the Add button you can add a source file to the project. The first file added to the project is the main project file.
This file will always be Make -ed.
The rest of the files added to the project will be automatically linked to the main project file on Make.
© 1998-2007 HP InfoTech S.R.L. |
Page 22 |
CodeVisionAVR
Multiple files can be added by holding the Ctrl key when selecting in the Add File to Project dialog.
When the project is Open-ed all project files will be opened in the editor.
By clicking on a file, and then pressing the Remove button, you will remove this file from the project.
The project’s file compilation order can be changed by clicking on a file and moving it up, respectively down, using the Move Up, respectively Move Down, buttons.
Changes can be saved, respectively canceled, using the OK, respectively Cancel buttons.
When creating a project with multiple files the following rules must be preserved:
•only .C files must be added to the project's Files list
•there's no need to #include the .C files from the Files list as they will be automatically linked
•data type definitions and function declarations must be placed in header .H files, that will be #include -ed as necessary in the .C files
•global variables declarations must be placed in the .C files where necessary
•there's no need to declare global variables, that are not static, in header .H files, because if these files will be #include -ed more than once, the compiler will issue errors about variable redeclarations.
© 1998-2007 HP InfoTech S.R.L. |
Page 23 |
CodeVisionAVR
2.2.4.2 Setting the C Compiler Options
To set the C compiler options for the currently opened project you must use the Project|Configure menu command.
A Configure Project tabbed dialog window will open. You must select the C Compiler and Code Generation tabs.
You can select the target AVR microcontroller chip by using the Chip combo box.
You must also specify the CPU Clock Frequency in MHz, which is needed by the Delay Functions, 1 Wire Protocol Functions and Maxim/Dallas Semiconductor DS1820/DS18S20 Temperature Sensors Functions.
The required memory model can be selected by using the Memory Model list box.
The compiled program can be optimized for minimum size, respectively maximum execution speed, using the Optimize for|Size, respectively Optimize for|Speed, settings.
The amount of code optimization can be specified using the Optimization Level setting. The Maximal optimization level may make difficult the code debugging with AVR Studio.
© 1998-2007 HP InfoTech S.R.L. |
Page 24 |