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

CodeVisionAVR

5. CodeWizardAVR Automatic Program Generator

The CodeWizardAVR Automatic Program Generator allows you to easily write all the code needed for implementing the following functions:

External memory access setup

Chip reset source identification

Input/Output Port initialization

External Interrupts initialization

Timers/Counters initialization

Watchdog Timer initialization

UART initialization and interrupt driven buffered serial communication

Analog Comparator initialization

ADC initialization

SPI Interface initialization

I2C Bus, LM75 Temperature Sensor, DS1621 Thermometer/Thermostat, PCF8563, PCF8583, DS1302 and DS1307 Real Time Clocks initialization

1 Wire Bus and DS1820/DS18S20 Temperature Sensors initialization

LCD module initialization.

The Automatic Program Generator is invoked using the Tools|CodeWizardAVR menu command or by pressing the CodeWizardAVR command bar button.

The File|New menu command allows creating a new CodeWizardAVR project. This project will be named by default untitled.cwp .

The File|Open menu command allows loading an existing CodeWizardAVR project:

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

Page 177

CodeVisionAVR

The File|Save menu command allows saving the currently opened CodeWizardAVR project.

The File|Save As menu command allows saving the currently opened CodeWizardAVR project under a new name:

By selecting the File|Program Preview menu option, the code generated by CodeWizardAVR can be viewed in an editor window. This may be useful when applying changes to an existing project, as portions of code generated by the CodeWizardAVR can be copied to the clipboard and then pasted in the project's source files.

If the File|Generate, Save and Exit menu option is selected, CodeWizardAVR will generate the main

.C source and project .PRJ files, save the CodeWizardAVR project .CWP file and return to the CodeVisionAVR IDE.

Eventual pin function conflicts will be prompted to the user, allowing him to correct the errors.

In the course of program generation the user will be prompted for the name of the main C file:

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

Page 178

CodeVisionAVR

and for the name of the project file:

Selecting the File|Exit menu option allows you to exit the CodeWizardAVR without generating any program files.

By selecting the Help menu option you can see the help topic that corresponds to the current CodeWizardAVR configuration menu.

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

Page 179

CodeVisionAVR

5.1 Setting the AVR Chip Options

By selecting the Chip tab of the CodeWizardAVR, you can set the AVR chip options.

The chip type can be specified using the Chip list box.

The chip clock frequency in MHz can be specified using the Clock spinedit box.

For the AVR chips that contain a crystal oscillator divider, a supplementary Crystal Oscillator Divider Enabled check box is visible.

This check box allows you to enable or disable the crystal oscillator divider.

If the crystal oscillator is enabled, you can specify the division ratio using the Crystal Oscillator Divider spinedit box.

For the AVR chips that allow the identification of the reset source, a supplementary Check Reset Source check box is visible. If it's checked then the CodeWizardAVR will generate code that allows identification of the conditions that caused the chip reset.

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

Page 180

CodeVisionAVR

For the AVR chips that allow self-programming, a supplementary Program Type list box is visible. It allows to select the type of the generated code:

Application

Boot Loader

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

Page 181