ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 2203

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

CodeVisionAVR

2.4.5 AVR Chip Programmer Setup

Using the Settings|Programmer menu command, you can select the type of the in-system programmer that is used, and the computer's port to which the programmer is connected. The current version of CodeVisionAVR supports the following in-system programmers:

Kanda Systems STK200+ and STK300

Atmel STK500 and AVRISP (serial connection)

Atmel AVRISP MkII (USB connection)

Atmel AVR Dragon (USB connection)

Atmel JTAGICE MkII (USB connection)

Atmel AVRProg (AVR910 application note)

Dontronics DT006

Vogel Elektronik VTEC-ISP

Futurlec JRAVR

MicroTronics ATCPU and Mega2000

The STK200+, STK300, DT006, VTEC-ISP, JRAVR, ATCPU and Mega2000 in-system programmers use the parallel printer port.

The following choices are available through the Printer Port radio group box:

LPT1, at base address 378h;

LPT2, at base address 278h;

LPT3, at base address 3BCh.

The Delay Multiplier value can be increased in case of programming problems on very fast machines. Of course this will increase overall programming time.

The Atmega169 CKDIV8 Fuse Warning check box, if checked, will enable the generation of a warning that further low voltage serial programming will be impossible for the Atmega169 Engineering Samples, if the CKDIV8 fuse will be programmed to 0.

For usual Atmega169 chips this check box must be left unchecked.

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

Page 58

CodeVisionAVR

The STK500, AVRISP and AVRProg programmers use the RS232C serial communication port, which can be specified using the Communication Port list box.

The Atmel AVRISP MkII, AVR Dragon and JTAGICE MkII use the USB connection for communication with the PC.

Usage of this programmer requires the Atmel’s AVR Studio V4.13 or later software to be installed on the PC.

Changes can be saved, respectively canceled, using the OK, respectively Cancel buttons.

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

Page 59

CodeVisionAVR

2.4.6 Serial Communication Terminal Setup

The serial communication Terminal is configured using the Settings|Terminal menu command.

In the Terminal Setup window you can select the:

computer's communication port used by the Terminal: COM1 to COM6;

Baud rate used for communication: 110 to 115200;

number of data bits used in reception and transmission: 5 to 8;

number of stop bits used in reception and transmission: 1, 1.5 or 2;

parity used in reception and transmission: None, Odd, Even, Mark or Space;

type of emulated terminal: TTY, VT52 or VT100;

type of handshaking used in communication: None, Hardware (CTS or DTR) or Software (XON/XOFF);

possibility to append LF characters after CR characters on reception and transmission;

enabling or disabling the echoing of the transmitted characters

number of character Rows and Columns in the Terminal window

Font type used for displaying characters in the Terminal window.

Changes can be saved, respectively canceled, using the OK, respectively Cancel buttons.

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

Page 60


CodeVisionAVR

2.5 Accessing the Help

CodeVisionAVR help system is accessed by invoking the Help|Help menu command or by pressing the Help toolbar button.

2.6 Transferring the License to another computer

The CodeVisionAVR C compiler features a computer locked licensing system.

This means that, the first time after purchase, you will receive from the author a license file that is specific to your particular computer.

This prevents you from using the software on another computer, until you will Export the license to this computer.

After the license Export, the compiler on the first computer will be disabled and you will only be able to run the compiler on the second one.

You can always Export the license back to the first computer, but the license on the second one will be disabled after that.

By this procedure only one person can use the compiler at a time.

To Export the license from the computer #1 to the computer #2 you must proceed like this:

install the CodeVisionAVR C compiler on the computer #2

execute the compiler on computer #2, it will display a specific serial number

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

Page 61

CodeVisionAVR

execute the compiler on computer #1 and select the Help|Export menu command, an Export CodeVisionAVR License dialog window will open

enter the serial number from computer #2 in the Destination Serial Number edit box

press the Export button, if you press the Cancel button the Export will be canceled

you will be prompted where to place the new license file for the computer #2, usually you can chose a diskette in drive A:

• press Save. After the new license file is successfully copied to the diskette, the compiler on computer #1 will cease running

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

Page 62

CodeVisionAVR

• place the diskette with the license file in drive A: of computer #2 and press the Import button. After that the license transfer is completed and the compiler will run only on computer #2.

Please note that after the Export procedure, the serial number of the computer #1 will change.

In this situation when you will try to Import a license back to this computer, you must enter this new serial number, not the old one.

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

Page 63


CodeVisionAVR

2.7 Connecting to HP InfoTech's Web Site

The Help|HP InfoTech on the Web menu command opens the default web browser and connects to HP InfoTech's web site http://www.hpinfotech.com

Here you can check for the latest HP InfoTech's products and updates to CodeVisionAVR.

2.8 Contacting HP InfoTech by E-Mail

The Help|E-Mail HP InfoTech menu command opens the default e-mail program and allows you to send an e-mail to: office@hpinfotech.com

2.9 Quitting the CodeVisionAVR IDE

To quit working with the CodeVisionAVR IDE you must select the File|Exit menu command.

If some source files were modified and were not saved yet, you will be prompted if you want to do that.

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

Page 64


CodeVisionAVR

3. CodeVisionAVR C Compiler Reference

This section describes the general syntax rules for the CodeVisionAVR C compiler.

Only specific aspects regarding the implementation of the C language by this compiler are exposed. This help is not intended to teach you the C language; you can use any good programming book to do that.

You must also consult the appropriate AVR data sheets from Atmel.

3.1 The Preprocessor

The Preprocessor directives allows you to:

include text from other files, such as header files containing library and user function prototypes

define macros that reduce programming effort and improve the legibility of the source code

set up conditional compilation for debugging purposes and to improve program portability

issue compiler specific directives

The Preprocessor output is saved in a text file with the same name as the source, but with the .i extension.

The #include directive may be used to include another file in your source.

You may nest as many as 16 #include files.

Example:

/* File will be looked for in the /inc directory of the compiler. */ #include <file_name>

or

/* File will be looked for in the current project directory. If it's not located there, then it will be included from the /inc directory of the compiler. */

#include "file_name"

The #define directive may be used to define a macro.

Example:

#define ALFA 0xff

This statement defines the symbol ‘ALFA’ to the value 0xff.

The C preprocessor will replace 'ALFA' with 0xff in the source text before compiling.

Macros can also have parameters. The preprocessor will replace the macro with it's expansion and the formal parameters with the real ones.

Example:

#define SUM(a,b) a+b

/* the following code sequence will be replaced with int i=2+3; */ int i=SUM(2,3);

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

Page 65

CodeVisionAVR

When defining macros you can use the # operator to convert the macro parameter to a character string.

Example:

#define PRINT_MESSAGE(t) printf(#t)

/* ...... */

/* the following code sequence will be replaced with printf("Hello"); */ PRINT_MESSAGE(Hello);

Two parameters can be concatenated using the ## operator.

Example:

#define ALFA(a,b) a ## b

/* the following code sequence will be replaced with char xy=1; */ char ALFA(x,y)=1;

A macro definition can be extended to a new line by using \ .

Example:

#define MESSAGE "This is a very \ long text..."

A macro can be undefined using the #undef directive.

Example:

#undef ALFA

The #ifdef, #ifndef, #else and #endif directives may be used for conditional compilation. The syntax is:

#ifdef macro_name [set of statements 1] #else

[set of statements 2] #endif

If 'alfa' is a defined macro name, then the #ifdef expression evaluates to true and the set of statements 1 will be compiled.

Otherwise the set of statements 2 will be compiled. The #else and set of statements 2 are optional.

If 'alfa' is not defined, the #ifndef expression evaluates to true. The rest of the syntax is the same as that for #ifdef.

The #if, #elif, #else and #endif directives may be also used for conditional compilation.

#if expression1

[set of statements 1] #elif expression2 [set of statements 2] #else

[set of statements 3] #endif

If expression1 evaluates to true, the set of statements 1 will be compiled. If expression2 evaluates to true, the set of statements 2 will be compiled. Otherwise the set of statements 3 will be compiled.

The #else and set of statements 3 are optional.

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

Page 66