Top Banner
Welcome to AVR Studio AVR Studio is an Integrated Development Environment (IDE) for writing and debugging AVR applications in Windows 9x/ME/NT/2000/XP/VISTA environments. AVR Studio provides a project management tool, source file editor, simulator,assembler and front-end for C/C++, programming, emulation and on-chip debugging. AVR Studio supports the complete range of ATMEL AVR tools and each release will always contain the latest updates for both the tools and support of new AVR devices. AVR Studio 4 has a modular architecture which allows even more interaction with 3rd party software vendors. GUI plug-ins and other modules can be written and hooked to the system. Please contact us if you are interested in more information about this. © Copyright ATMEL Corporation. All rights reserved. AVR and AVR Studio are trademarks of ATMEL Corporation. Windows XP, Windows 98, Windows NT, Windows 2000 and Windows ME are trademarks of Microsoft Corporation.
38

Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Mar 06, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Welcome to AVR Studio AVR Studio is an Integrated Development Environment (IDE) for writing and debugging AVR applications in Windows 9x/ME/NT/2000/XP/VISTA environments. AVR Studio provides a project management tool, source file editor, simulator,assembler and front-end for C/C++, programming, emulation and on-chip debugging.

AVR Studio supports the complete range of ATMEL AVR tools and each release will always contain the latest updates for both the tools and support of new AVR devices.

AVR Studio 4 has a modular architecture which allows even more interaction with 3rd party software vendors. GUI plug-ins and other modules can be written and hooked to the system. Please contact us if you are interested in more information about this.

© Copyright ATMEL Corporation. All rights reserved. AVR and AVR Studio are trademarks of ATMEL Corporation. Windows XP, Windows 98, Windows NT, Windows 2000 and Windows ME are trademarks of Microsoft Corporation.

Page 2: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Welcome to AVR Studio 4.13 Service pack 1 (8/2007)

This release contains all the contents of earlier service packs and part packs. Please see release history for information about earlier releases.

Part support

The following new parts have been added to AVR Studio:

- ATmega16HVA, AT90USB162, AT90USB82, ATmega328P, AT90PWM216, AT90PWM316

Check the device matrix to see which devices are supported by which tools.

New Features

• Enhanced XML files for the new I/O view, providing e.g. combo boxes for configuration registers in all devices.

Bug Fixes

The following sections list the bugs that were present in AVR Studio 4.13, but that have been fixed in SP1. Several other minor bugs has also been fixed. Please also see the specific tools help books for a listing of bug fixes in specific tools.

General

6092: 'Find in files' function does not include the last line of the search. The 'Find in files' function does not include the last line of the searched files in its search area.

4372: Typing the letter "v" in the name column of the watch window results in "Ctrl+V" behavior. When manually entering the name of a variable to be watched in the name column of the watch window, typing a "V" results in text being pasted from the clipboard instead of the letter being written.

4794: AVR Studio USB drivers does not support Windows XP x64.

4864: Pressing F1 in the Programming Dialog can bring up multiple help windows

Page 3: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

GUI

6096: Tools must be added both in debug and edit mode. When adding your own tools to the AVR Studio menus using the customize function, the tool must be added both in edit mode and debug mode (i.e. two times) to be visible in both modes. This is because AVR Studio has different workspace set-ups for the two modes.

3998: It is not possible to set watch on a variable from the disassembly window. When highlighting a variable in the disassembly view, it is not possible to add it as a watch item.

2709: The register window shows register 31 (R32) twice at the bottom of the window.

4076: Studio toggles between showing relative and absolute filename in title bar. Some actions, e.g. saving a file, will make the file name displayed in the title bar change from absolute to relative.

4734: When saving a file with a new name ("Save As...") the original file cannot be opened. If the contents of the text editor is saved with a new name using the "Save As..." command, the original file cannot be opened in Studio before the renamed file is closed in Studio.

Editor

475: Pressing F10 to single step focuses the File menu Pressing F10 to single step focuses the File menu and some times toggles which window has the input focus.

4694: Editor's behavior during run-mode is inconsistent Users may only partly edit source files when the code is running on target. The user may type and add new code but not use features like text select etc.

Part Description Files

6059: New IO view only displays SRAM address of IO registers The new IO view only displayed the SRAM address of IO registers. This was confusing for users who expected to see the IO address. The window now displays both the IO and the SRAM address.

5547: PRR register erroneously named PRR0 in ATmega644 XML file

Note: Windows 95 is no longer supported by AVR Studio. The most recent version that supported Windows 95 was AVR Studio 4.12 SP3.

Page 4: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Tools and device support AVR Studio 4 support all new Atmel AVR debug platforms and devices. See below for a table of currently supported tools and devices in AVR Studio 4.

Page 5: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Supported in compatibility mode

Abbreviations ISP: In System Programming HVSP: High voltage serial programming PP: Parallel Programming high voltage dW: debugWire

Note: AVR Dragons does not support debugging on devices above 32kB.

Page 6: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Known issues Below is a list of currently known issues for AVR Studio 4. (Last updated 12/2006)

Generic

Some users can not select any devices for debugging, and/or the debug session will never start. Typical only the ATmega128 is available for selection when using ICE40/50, simulator or JTAGICE mkII. This is probably caused by some DLL files being damaged and/or having wrong versions. We have identified two actions that can help to solve these issues:

1) Make sure you have the latest Internet Explorer version 6(or later) installed with the latest service pack.

2) Install the Microsoft XML Parser (MSXML) 3.0 Service Pack 4 or later (SP4). AVR Studio 4 uses the XML parser extensively. This package can be downloaded from the following site:

The Microsoft® XML Parser (MSXML) 3.0 SP4 http://www.microsoft.com/downloads/details.aspx?FamilyID=c0f86022-2d4c-4162-8fb8-66bfc12f32b0&DisplayLang=en

Note: The latest version of the XML parser (MSXML 4.0 SP2) is now included with the AVR Studio 4.13 release. This should prevent the problems described above. If not, work-around is still to reinstall the latest MSXML package.

Note about moving the project files. Path to files are stored as absolute paths in the project file, opening a copied project file will still try to locate the files in the old location. The safest way to bypass problems is to create a new project at the new location.

Sometimes you may experience problems when loading AVR Studio 4 projects. Close AVR Studio and remove the project file (APS). Then startup AVR Studio and try again by creating a new project.

Usually the initialized EEPROM data or SRAM is automatically uploaded to the EEPROM memory of the debug platform after a user confirmation. If this does not happen, you can do this manually by selecting 'Up/Download memories' after loading the project.

If the last statement in a function is part of a loop,and there is no explicit return statement, Step Out may not work as expected. A work-around for this problem is to put a "return;" statement at the end of the function. This problem has been seen with the Imagecraft C Compiler and may be experienced with other C compilers.

The 'Find in files' function does not include the last line of the searched files in its search area. To work around this problem, make sure there is an empty line at the end of each file.

USB

Windows XP 64: If the USB drivers was not installed with version 4.13, upgrading to SP1 or doing modify on the installation will not work for adding USB drivers. This results in an AVR Studio 4 crash or that no connection is established. To add USB support for Windows XP 64, AVR Studio 4.13 must be uninstalled and reinstalled with USB option enabled. Windows Vista 64: USB is not supported on Windows Vista 64.

Page 7: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Customize

When using the customize function in AVR Studio you can add your own tools and change/add accelerator keys. There are some issues:

1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the tool item is added. Therefore you must add the tool two times to be available in both edit and debug mode. Also, the tools you add when working in an assembler project will not be available when working with a C/C++ project.

2) When installing new version of AVR Studio you will loose all customize settings.

Installation

We recommend you to uninstallAVR Studio properly before you install a new version.

If you have modified any of the AVR Studio 4 installed files, they may not be overwritten/upgraded if a newer version is installed. Then make sure you uninstall before installing a new version.

We recommend that the latest version of MS Internet Explorer is installed. We require its library functions because of extensive use of XML file parsing within AVR Studio 4. Unexpected behaviour may occur if this is not installed.

It is important that you have all the latest service packs installed on your OS. Some installation problems may be caused by not being up to date on service packs for the OS. If you still experience install problems after a complete OS and service pack update, you may try to download the latest installer update from Microsoft: http://www.microsoft.com/downloads/details.aspx?FamilyID=889482fc-5f56-4a38-b838-de776fd4138c&DisplayLang=en

Page 8: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

GUI-User Interface

Problem with editor in Middle East versions of Windows 95/98/Me (Arabic and Hebrew) Due to an error in the system libraries, the editor does not work properly on these Window versions. Work-around: Install Windows 2000, XP or NT.

If an object file is reloaded after part has been changed the following messages might appear: The contents of the object file exceeds the maximum program memory of the device. Error loading object file (filename) AVR Studio can now be left in a position where platform/part cannot be changed and debug mode cannot be entered. To work-around this, close AVR Studio and restart the application.

To open a HEX file for both debugging and at the same time as a text file may cause problems. Work-around: 1) Debug file: Use the Project Wizard and select open. 2) Text file: Use the menu File->Open File and select “Text” in the “Open As” dropdown box.

The size and position of the vertical scroll bar in the trace view is not always mathematically correct. This is due to the fact that the number of displayed trace records/source lines are unknown until displayed. To maintain update speed, records are fetched and decoded as needed for the view.

Menu access, work-around. When using the ALT key in combination with other keys to access the menus you MUST keep the ALT key pressed down while navigating in the menus.

The I/O memory view will tag the addresses from 0x00 to 0x3f although the "real" address is 0x20 to 0x5f. All other views show the "real" addresses. This is done to make use of the I/O view more convenient to the user as I/O instructions like in and out have base address 0x00. Tooltip information will not be visible in a floating memory view. Work-around: Make it docking again.

All visible memory locations that are changed during a debug session will be marked red. When using the scrollbar the coloring will disappear in the memory window

If the toolbars, buttons or windows get messed up, you can enable the option "Reset desktop on restart". Just restart AVR Studio to activate it again.

The text color in the device selection box may be confusing when out of focus. The selected device will now be inverted white, and may look "unselectable".

New project + Project wizard. If you have started a debug session and a new project is selected, the project will be closed down. Cancel will not take you back.

It may cause problems to use national characters in project and filenames. Work-around: Avoid using these when creating a new project or new text files.

Mouse wheel support in editor and memory views are not automatically supported when OS is WinNT or Win95. Please download and install a driver from your vendor to have this option.

The wheel mouse does not work in the register window.

Page 9: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

JTAGICE/JTAGEICE mk2

Some I/O registers are not accessible in a JTAGICE debug session. See the JTAGICE online help for more information.

Note that the Cycle Counter for a debugging session with the JTAGICE will always be 0. This is because the JTAGICE does not implement a cycle counter. The frequency and stopwatch will also be disabled in the GUI.

When using the ATmega128 in 'ATmega103 compability mode', note that the SRAM memory boundaries for ATmega128 are displayed in the memory window, not the boundaries for ATmega103. Also, note that the I/O registers for ATmega128 will be shown in the I/O window, not the I/O registers for ATmega103.

See the JTAGICE online help for more known issues and information.

ICE 50

The dialog window for the ICE50 target options does on some occasions appear behind the AVR Studio main window. When this happens, the AVR Studio main window appears to be locked until the ICE50 target options are closed.

If AVR Studio initiate an upgrade and the Upgrade program fails to connect to the ICE50, make sure to close down AVR Studio.

If you reset the ICE when in EDIT mode (disconnected after debug), all the settings on the ICE will be lost, and various error messages may occur when connecting again. You should then close the project and reopen it again to reload your settings.

Make sure you upgrade your ICE50 with the serial port.

If XircomPortGear(USBtoSerial) is used and ICE50 is not connected, it may be unstable. Make sure the ICE50 is connected and powered.

See the ICE50 online help for more issues and information.

Page 10: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

STK500

If you discover problems when connecting, make sure you have stopped any debugging session that may use the actual COM port. Example; you can not connect with the STK500 dialog at the same time being connected with a debug session on the same port.

See the STK500 online help for more issues and information.

IAR Compiler

The Generate debug info option causes the compiler to include, in the object modules, additional information required by AVR Studio. By default, the optimization level is none.

Note that only optimization levels None and Low will generate code that is fully debugable with AVR Studio.

Currently, AVR Studio supports the UBROF 8 debug format and earlier versions. IAR EW 3.10 by default generates UBROF 9. See the Object files format and support section for information on how to make IAR EW 3.10 generate UBROF 8.

If you have selected "Source files embedded in object file", AVR Studio will generate a temporary folder called embedded, and put all source files below here. The source files will get a name with prefix _embXX. Make sure you have write access to the debug folder.

Page 11: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

AVR-GCC Compiler and DWARF2 Debug format

Note that the AVR-GCC compiler must be correctly configured to support DWARF2 output. Presuming the compiler supports DWARF2 output, the format is generated using the -gdwarf-2 option.

1. 64K limit on flash size. (WinAVR releases prior to 2007-01-02) The mapping between program addresses and source code locations output by older avr-gcc versions breaks when addresses pass beyond 64K. This has been fixed in WinAVR releases after 2007-01-02, and acommodations for this fix has been made in the AVR Studio elf/dwarf parser.

2. Wrong display of eeprom and progmem variables in the watch view. (WinAVR releases prior to 2007-01-02) Object files made with avr-gcc from WinAVR versions prior to 2007-01-02 do not contain information to discern between eeprom, progmem and sram addresses. AVR Studio parser therefore assumes sram for all variables. Later WinAVR versions provide an avr-gcc that generates objects with this information. The AVR Studio elf/dwarf parser will in this case present correct information about variables from both progmem, epprom and sram memories.

3. Step-out-of does not work on jtagice mkII (#672)

4. Multi-dimensional arrays (#3249) Multi-dimensional arrays are displayed all in one level in the watch window in AVR Studio.

5. Debugging and working with C++ projects is not yet supported (#5045, #5047)

6. Debug information for bitfields is wrong as output by avr-gcc (#393) It will not be possible to watch bitfields in the watch view.

7. The Watch view reads 'Location not valid' for some variables (#572) The ELF parser does not support all DWARF location expressions. If it encounters one that is not supported, the watch view will read 'Location not valid'.

8. Custom-defined eeprom sections are not stripped from hexfile (#5271) Custom-defined eeprom sections in the AVR GCC plugin are not stripped from the generated hexfile.

Simulator

TWI, USI and analog peripheral simulation is not yet implemented. All instructions, interrupts and other peripherals are supported. Shadow register support is missing in AVR Studio. As a consequence when operating PWM in fast- and phase correct mode, the OCR register should not be updated until TCNT is at TOP.

The Asynchronous Status Register (ASSR) is not supported in timers with asynchronous mode. This is due to lack of a generic external clock implementation. The simulator will output a warning each time it encounters an instruction that is not supported by the device that is executing. This function cannot be turned off. To avoid the message, rewrite the application so that it does not use the instruction that generates the warning. See the Simulator Help for more information.

Page 12: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

WATCH

char[] must be expanded after initialization to be correct. On some occasions the sub elements of an expanded array are not correctly updated in the watch window. A workaround to force an update of the watched array elements is to collapse and then expand the array again.

Bitfields are not displayed correctly in the watch window. The bitfield is displayed, but the value is not masked correctly, so that the displayed value is likely to be wrong. When watching enum variables from an IAR (UBROF) or Imagecraft (COFF)project in AVR Studio, the watch will display the numeric value of the enumvariable, not its string value.

For COFF output, "long long" and "long double" variables are not displayed. For COFF output, global variable can't be watched when stepping through library code (the yellow pointer,Program counter, is pointing at library code)

The watch window functionality is dependent of a compiler/assembler that creates symbolic output. For instance IAR that creates UBROF(.d90) and Imagecraft/Codevision that creates COFF(.cof). Make sure you have enabled the correct option for making correct debug information output in your compiler options setting dialog.

New from version 4.06 is that watches are supported for the AVR assembler. Make sure the .map file is generated (default on)

C++ class member variables are not looked up automatically. Type the symbol 'this' instead and expand it to see the member variables.

Page 13: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Installation and update Once AVR Studio has been installed, it can be started by selecting "AVR Studio 4" in the AVR Tools section on the Start Menu. If an In-Circuit Emulator or an on chip debugger is the desired execution target, remember to connect and power up the board before opening any project.

Make sure the USB driver installation has been performed if planning to use a tool with USB support. See USB Driver Installation.

AVR Studio is updated frequently and available for download on WEB at www.atmel.com. To install the WEB version run AVRSTUDIO.EXE to extract the setup files. Then run setup.exe and follow the on-screen instructions to install.

Requirements

Windows 98/NT/2000/XP/XP x64/VISTA Internet Explorer 6.0 or later (Latest version is recommended)

Recommended hardware: ~ Intel Pentium 200MHz processor or equivalent ~ 1024x768 screen (minimum 800x600 screen) ~ 256 MB memory ~ 100 MB free hard disk space

We always recommend to have the latest OS versions and Service packs installed. We also recommend Internet Explorer 6 or later.

Page 14: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

USB Driver Installation

In order to use any emulator/programmer using USB it is required to install the USB driver. Please do not connect the emulator/programmer to the computer before running the USB Setup. USB driver installation is done during the AVR Studio installation.

Start the AVR Studio installation. During this installation the dialog box in the figure below will be presented to the user.

To install the USB driver, check the Install/Upgrade USB Driver checkbox, and the USB Driver will automatically be installed.

Page 15: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Install new hardware on the computer

When AVR Studio and USB driver installation is finished, please attach the USB cable to both PC and emulator/programmer. If it is the first time the emulator/programmer is connected to the computer, the box below will appear:

If running Windows XP you need to click "Next" a couple of times. Please wait until the installation process completes by itself. It may take from a few seconds up to a few minutes depending on the computer and operating system.

If the USB driver is correctly installed and emulator/programmer is connect to the PC, the green LED inside the encasing next to the USB connector will be lit.

If the AVR Studio for some reason can't detect the emulator/programmer after the USB setup, try to restart the computer in order to get the driver properly loaded.

Install USB driver after AVR Studio is installed

The USB driver can be installed even after AVR Studio have been installed by following these steps:

Open "Control Panel" on the PC (Windows 95 and Windows NT does not support USB)

1. Select "Add or Remove Programs" 2. Select "AVRStudio4" in the list of programs 3. Click on the "Change" button 4. Select "Modify" 5. Select "Install/upgrade USB Driver"

The USB driver is now properly installed on the PC

Page 16: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Release history Please see the help files for the release information.

Page 17: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Contact Information Please report any problems you experience with this version of AVR Studio. We would also like to receive good ideas and request that can help to improve further development and releases of AVR Studio.

For support email [email protected]

For the latest updates of AVR Studio, please visit our web site: www.atmel.com

For information about the AVR Studio 4 Software development kit, please visit our web site: www.atmel.no/SDK/

For technical AVR Studio 4 questions email us at [email protected]

Bug Report

Copy the information from the version dialog (se figure below) and include it in the email to Atmel. Also, make sure to provide a detailed description of the problem:

1) Describe how to recreate the problem 2) Attach any test program that causes the problem 3) Check that the copied version information contains used debug platform and Device.

Figure: The version dialog are opened by the file menu Help->About, then push the Version button. Debug platform and device are only displayed if you are in debug mode. Push the copy button to copy the contents to the clipboard.

Page 18: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

AVR Simulator V2 Preview Introduction

The new simulator V2 offers a cycle correct and accurate simulator with complete peripheral support. The model are converted automatically from the real hardware source and therefore minimizes the risk of annoying conversion bugs. Our goal is to offer early and accurate simulator support for all our new devices.

Important: Please note that this project is still under development, and with AVR Studio 4.13 we have included a technical preview. We don't guarantee a complete and working model with this release. We welcome any feedback including both feature requests and bug reports.

Parts supported

ATmega128 ATtiny25/45/85

Known issues

-Clocking with PLL timer is currently not working for the tinyx5 family in the simulator model.

-Selection of clock sources are currently not available.

-Default fuse settings are the same as described in the device data-sheet, but with the following deviation: ATmega128: mega103 compatibility is not set. ATtinyx5: SPM enable is set.

-Analog simulation is not yet supported.

-Stimuli functions are not yet supported.

-Memory transparency in stop mode are not complete for all I/O locations.

See also Simulator guide.

Page 19: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Getting Started with IDE development

Introduction

Those of you that have multiple years experience with microcontroller development can skip this part and advance to the next topic. This section is intended for those of you that are new to using an integrated development environment when designing with microcontrollers.

AVR Studio 4 is a large piece of software, it supports several of the phases you usually go through when you create a new product based on an AVR microcontroller. Typical phases are:

1. Product definition. Based on your knowledge of the task you want to resolve and market input, the product that should be created is defined.

2. Formal specification. A formal specification for the product is defined. 3. A project team consisting of from one to many are assigned the task of creating

the product based on the formal specification. 4. The project team goes through the normal sequence of design, development,

debugging, verification, production planning, production, test and shipment.

AVR Studio supports the developer in the design, development, debugging and verification part of the process. I'll try to give a brief presentation of why and how to use this tool in the following sections.

Tools of the trade

AVR Studio 4 consists of many views and sub-modules. Each of them supports parts of the work you try to undertake. The major views are described in the following.

Project management

All code creation within AVR Studio is done as programming projects. All code projects has a project file that maintains information about the project, which files are included, assembler set-up, customized views and so forth. The project file ensures that the project stays the same every time you come back to it, and that everything is set up properly and will assembler / compile.

Editor

This is the place you do the actual work of coding. AVR Studio 4 uses the Stingray editor from Bsquare corporation. It is a full fledged programming editor with all the functionality that you are used to, including syntax color coding (that can be altered and extended by the user). The editor window is also used when you debug your code, break and tracepoints can be set at the left margin of the view. The usage is straight forward.

Page 20: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

The output tabs

is a collection of several views integrated into one tabbed frame. The tabs on the frame selects the view you want. You can select from:

• The Build view. Output from the compiler / assembler is routed to this window. The result of the compilation / assembly can be read here.

• The Messages view. AVR Studio 4 is made up by many SW objects encapsulated with Microsoft DCOM technology. Quite a few of the software objects has no user interface of their own. The Messages window is the common window for all modules of the software to present messages to the user. Messages are color coded. Most messages are plain messages of no significant priority. They have no color. Warnings signalling potential problems are yellow. Errors are red. All messages can be time stamped (right click your mouse over the window and select the time stamp option). There is even a filter function enabling you to turn messages on and off.

• Find in files view. The AVR Studio 4 has an advanced "find in files" function. The result of the search is routed to this window.

• Breakpoints. Lists all active breakpoints in all modules. Breakpoints can be enabled, disabled and removed in the view.

The workspace tabs

AVR Studio 4 workspace view consists of a number of views that are intended to help the developer to debug the code he has written in a systematic way:

The Project View

The Project view lists the files that are included in your code project, if you have created a code project. If you have opened an object file for debugging, the project view shows the name of the currently loaded object file as well as the source files that the object file refers to.

Page 21: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

The I/O View

The I/O view is divided into:

• The register file section. All AVR controllers have a set of 32 general purpose registers that freely can be used by the programmer or the compiler. Every time a simulation or an emulation breaks, the view is updated with the current values of the internal registers in the part. If the value has changed since the last break, the register appears color coded.

• The processor core register section. As for the register view, the processor registers are updated when the execution breaks. Here you can view the program counter, the stack counter and so forth.

• The I/O register section. Each different AVR device is defined through the peripherals the device supports. An ATmega128 has a completely different set of peripherals compared to an AT90S8515, but the core and the instruction sets of the two chips are quite equal. All peripherals are controlled through 8 or 16 bit registers that can be read and/or written. The I/O view is configured for the part you have selected and shows all registers and bits logically grouped. Bits and registers can be both read and written when the emulation is in break mode. This view gives you total control over the device subjected to debugging. This view is a major difference from integrated development environment such as Microsoft Visual Studio, which relates to the underlying operating system and not the microcontroller itself. The view itself is based on a XML script, and a new script is made available for each new device released by Atmel. Device updates is done through the Atmel homepage on the web.

The Info View

The info view is divided into:

• The interrupt vector section. The interrupt vectors for a device usually reflects the peripherals. Thus they are different for each AVR device. This view lists all interrupts and their corresponding interrupt vector addresses. Useful stuff if you are to program interrupt service routines (and most microcontroller programmers are!)

• The available packages section. Lists the available packages of the device, and the corresponding pinout of each package. The tooltip help will contain information on the use of most pins. Again, this is a useful feature if you are debugging both HW and SW, you have the necessary pin information in view at all times.

• Registers, this is a complement to the I/O view. The I/O view displays all registers grouped logically into peripheral functions. The register view lists all registers from high to low address

Page 22: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

The Watch View

Debugging high level languages as C/C++ you need to watch variables. With tools like AVR Studio 4 this is an easy task, click on the variable you want to watch and drag-and-drop it into the watch window. If the variable you selected is a struct or an array a [+] symbol will occur in front of the variable, indicating that it can be expanded in the view. When the execution breaks, the variable automatically will be updated - if it is in SCOPE. Different languages define their scopes differently, to be in scope simple means that the variable actually exist in memory at the location where the program stopped it's execution.

The Memory View

A microcontroller like the AVR can do nothing without memory. The code executed lies in the program memory, the variables are located in SRAM (mainly), the I/O registers are mapped into I/O memory area, and the EEPROM is yet another memory area. The Memory View is able to display all the different memory types associated with the AVR devices. And as for the watch and the I/O view, the area in display on the screen is automatically updated when an execution break occurs. Very simple.

Page 23: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Code projects

AVR Assembler

are easy! Currently the AVR Assembler is supported. This will change in the months to come, as AVR Studio is designed to be a front end to other assemblers and C/C++ compilers as well, check the WEB for upgrades, but currently you write code with the aid of the AVR Assembler. For small program systems it is not a bad choice, it supports all the different AVR parts through the it's DEVICE directive, which will help you from using instructions not supported in the device you have selected, and it is blistering fast due to the fact that it assembles executable code directly, there is no linker stage.

To get started is simple, when AVR Studio loads, select the AVR Assembler from the project dialog box, select a project name directory where the project shall reside, and click finish. A project file is created, an *.asm file is available in the editor window and you are set for writing your first instructions. Check out the online help. The AVR assembler has it's own book where all instructions and directives are explained. In addition, there is context sensitive help in the editor window, just write an instruction, place the cursor on top of the instruction and press F1, and you will get help on the syntax on the selected instruction.

If you develop for a specific device in mind you should include the *.def.inc file for the part. Each part has it's own *.inc file that defines all internal registers, bits and a lot of other stuff that makes it simpler for you to write code for the part. In addition the *.inc file sets the device directive for the assembler, letting the assembler know which part you are developing for.

The part files are found in the \Program Files\Atmel\AVRTools\AVRAssembler\Àppnotes folder on your computer. A include file for ATmega8 will typically be named "m8def.inc". You do not have to give a path with the *.inc file as long as it is found in the default directory.

Press F7 in order to compile. The result of the compilation will show in the previously described Build view in the output window frame.

A programming project can be set up in minutes!

Page 24: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Debugging external code projects

For larger code projects, assembler may not be nirvana. C/C++ may be. There is a number of good C compilers available for the AVR family of microcontrollers including the compilers from IAR and Imagecraft which can be purchased, or the AVR GCC compiler that can be downloaded from a number of sites, including www.avrfreaks.com.

Using these compilers, you typically program in an environment set up by the compiler vendor. You maintain your code project in a 3rd party tool. You typically set the compiler to produce code in DEBUG mode, which means that references to the high level code will be added to the compiled source. When you compile and link, you create an object file, and that object file can be loaded directly in AVR Studio 4.

Different compilers uses different object file formats. A number of formats are supported by the industry, some are proprietary for the compiler vendor company (like UBROF from IAR) and some are open and documented for everyone (like ELF used by the AVR GCC C compiler). In order to understand the code that your compiler and linker created AVR Studio must use an object file parser.

Currently AVR Studio 4 supports and will automatically detect UBROF (IAR), Nordic (AVR Assembler), COFF (Imagecraft, Codevision, ELAB, etc), and Intel Hex object files. An ELF/DWARF object file parser is in the planning.

In order to use an externally created objectfile with the AVR studio, use the Open Object File option in the File pulldown menu. If the file is created in debug mode, AVR Studio will create some magic: It opens the file, detects which object file format is used, locks up the source code and displays the source code in the editor view. If you have an emulation platform available (or have selected the internal simulator) you are ready to rock: Pressing F5 will start the selected debug mode. You can set breakpoints in the code view, you can crag-and-drop variables down to the watch view, you can manipulate the controller through the use of the I/O view.

So, external code projects and AVR Studio 4 is an easy match.

Page 25: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Using AVR Tools

Atmel makes a number of HW tools designed to make your life as a developer easier. The current version of AVR Studio 4 supports the following tools:

• ICE50. This is a brand new high end In Circuit Emulator. When you use it, you remove the AVR controller from your target hardware and replaces it with the probe /personality adapter from the ICE. The ICE50 hooks up over a fast serial communications link (in the future it will also use USB). When you select RUN in AVR Studio, AVR Studio downloads the code to execute together with information about breakpoints, tracepoints, processor speed, you name it, to the ICE, and the tells the ICE to run until it hits a breakpoint in the code or a break condition occurs. The ICE behaves EXACTLY like the chip it emulates. When a break condition is hit, the ICE50 will notify AVR Studio, and the AVR Studio will request information about all details of the chip that is in display in the screen, such as the value of all internal registers, the stack pointer, memory contents and so forth. The ICE50 is an FPGA based implementation of the part with additional HW for emulating the analog parts of the device. It also includes trace, which basically means that every instruction it executes including arguments is stored in memory, and when the user breaks, all instructions can be displayed in readable form in a trace view. This can be an excellent tool for finding errors in the execution flow. This is an indispensable tool for large high level programming language projects, and it is also an excellent tool for finding errors in the target HW design.

• JTAGICE. This is also a rather new low cost high performance In Circuit Emulator. The larger ATmega devices (the ones with >= 16KByte flash memory) includes a JTAG/OCD high speed communication port. In HW on those devices (currently ATmega128, ATmega323, ATmega32, ATmega16) there is circuitry that can stop the part and read out the internal state of the part including the value of internal memories and registers.

• STK500 / 501 is a very successful Starter Kit. It supports all AVR devices, it has LED's and switches so you can write programs for your device that reacts to real life events, and all programming modes of the device is supported. You can also use it as a test target for ICE50 or JTAGICE. STK501 is a mezzanine board that supports the ATmega128 TQFP package. It includes adapter for the JTAGICE.

• AVRISP. The new In System Programmer. Make an ISP port on your target design and program / reprogram your device. Simple as that.

Together, AVR Studio 4, ICE50, JTAGICE, STK500/501 and AVRISP makes a complete code creation, simulation, emulation, programming and test environment for the new Atmel AVR parts.

Page 26: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

AVR Studio projects Introduction

AVR studio is an Integrated Development Environment (IDE) for writing and debugging AVR applications. Currently as a code writing environment, it supports the included AVR Assembler and any external AVR GCC compiler in a complete IDE environment.

Many object file formats are also supported from various compiler vendors. You can open and debug these files, but you are not able to edit the code from within AVR Studio. Using your own editor to edit code and AVR Studio to debug (use the reload button), you still have a powerful code/debug environment.

Using AVR Studio as an IDE gives you 2 main advantages:

1. Edit and debug in the same application windows. Faster error tracking. 2. Breakpoints are saved and restored between sessions, even if code are edited

Save and open projects All projects are saved with your selected name with the ending APS. When the user wants to reopen a project, this can be done under the file menu and the recently used file list, or under the project menu, open project.

Project Output view After building,assembling or compiling the project, the build output window prompts with messages. If any errors occur, the user can double-click on the message, and the marker will show correct position in the source window.

Page 27: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Startup wizard The startup wizard are displayed every time you start AVR Studio 4. From within this dialog you can quickly reopen the latest used projects, change debug platform/device setup or create a new project. Just double-click on the wanted project and it will automatically open and restore to its last settings.

The startup/project wizard can also be opened from the project menu. Other functions are described in more detail below.

Show this dialog at startup Uncheck this checkbox if you don't want to display this dialog on startup.

New project - If you want to create a new project, use this function. This is described in more detail later is this manual.

Open - If you want to load an existing project or a single debug object file, press this button.

Next Step - This button is highlighted when a project is selected. Press next to select platform and device to eventual change the debug platform or device setup for the selected project. Load - Load the selected project.

Help – opens the help file.

Page 28: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

New project Description Select Project->new project from the menu, and the dialog below will appear. The startup wizard will also have this option.

Project types Currently two project types are available listed in the project type list box. Atmel AVR Assembler and AVR GCC. The assembler (AVRASM2) are distributed with AVR Studio, but you have to download a GCC compiler to create and use an AVR GCC project.

Projects can also be created by loading supported object files. File->Open file must be used to create such projects.

Project name and initial file Input the project name. Default the initial file will have the same name (ASM or C) and will be created, but this can be changed. A folder with the project name can be created, but this is not default selected.

Next Step If project name and project type are ok, press next to select platform and device to simulate/emulate. You can also finish now, but then the debug platform and device must be selected when a debug session is started.

Page 29: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Object files Description

Object files can be loaded by using the menu command Open file. See the Object files format and support for more information. If the project is moved from the original location where it was build, you will be asked to select a folder where the source files resists. The source will then be re-mapped and saved in the project file for use next time you load the project. The mapping can be cleared by deleting the project file (APS) The project view will display all your project files, but them will be set as read only.

Page 30: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Assembler project Description

When a new project is created or an old project is loaded, the project view will be displayed with all the project files. Files can be added, created or removed from the project list using the context menu.

Source files All the source files are listed below this item. The entry file is marked with a special icon , and can be changed using the context menu. Double click on any file to open it in the editor.

Included Files All include files are listed here. Double click on any file to open it in the editor.

Labels All labels in your assembler program are listed her. Double click (or use space) on any item to show its location in the source. A blue marker will point to the correct line.

Output All output files will be displayed below this item

Object file Name of the output object file

Page 31: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Context menu

Rigth click menu, commands Shortcut Description

Set as entry file SPACE Set the selected file as entry file

Open file ENTER Open the selected file

Remove file DEL Remove the selected file from the project

Create new file Shift-INS

Create a new file and add it to the project

Add existing file INS Add an existing file to the project

Docking This is a docking view. You can switch between docked and un-docked with the right menu command Docking view

Build menu and toolbar

Two build commands are available from the menu and toolbar:

Assemble (F7) Will assemble the entry file.

Assemble and run(CTRL+F7) Will assemble the entry file and start debugging automatically if the assemble operation succeed.

Page 32: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Assembler Options Open the options window on the menu Project->Assembler Options. This menu item is only available when an assembler project is open.

Description of the various settings

Hex Output format The following file formats can be selected as additional output format: 1. Intel Hex 2. Generic Hex 3. Motorola Hex (S-record)

Create Map file This option is always set on. A MAP file will be created and added to the project view when the build command is executed.

Create List file A LST file can be created when the build command is executed. Default this option is off.

Page 33: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Wrap relative jumps The AVR RJMP/RCALL instructions allow a 12-bit PC-relative offset, corresponding to +/-2k words. For devices with 4k words (8k bytes) or less FLASH program memory, the Wrap option causes the assembler's offset calculation to wrap around over the addressable program memory range, enabling the entire program memory to be addressed using these instructions.

For devices with more than 4k words of program memory, using this option may cause unpredictable results and it should be turned off. If it is left on, the assembler will produce a warning when wrap takes effect:warning: Wrap rjmp/rcall illegal for device > 4k words - Turn off wrap option and use jmp/callThis diagnostic is given as a warning and not an error to retain compatibility with earlier versions of the assembler, but should be treated as an error by the user. The JMP/CALL 2-word instructions take 22-bit absolute addresses and should be used instead.

AVR Assembler Select between assembler v2(default) and assembler v1. If you have compatibility problems with the new Assembler v2, you can optionally use the old Assembler v1. Options for Additional parameters and Unsupported Instructions will not be available when using Assembler v1.

Unsupported Instructions Default this option is set to give an error when the assembler finds unsupported instructions for the actual device. Optionally, you can output a warning. NOTE: You have to include the correct include file for this option to work properly. This option is only available for Assembler v2.

Additional Include Path Additional Include path can be set when using the Assembler v2. The default include path can be changed when using Assembler v1. Assembler v2 default path: \Atmel\AVR Tools\AvrAssembler2\Appnotes Assembler v1 default path: \Atmel\AVR Tools\AvrAssembler\Appnotes

Additional Parameters Additional parameters (options) can be set when using the Assembler v2. Note the question mark (?) which give you a direct link to the assembler help page which describes the additional parameters.

Page 34: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Descriptions of the buttons

OK The Dialog will be closed down and the actual settings will be effective. The project settings are saved to the project file when the project are closed or manually saved.

Cancel The Dialog will be closed and the actual changes in the settings will not take effect.

Set Default Set the current settings as default settings when creating a new project. All the visible options are saved, not the advanced options.

Reset settings Restore the current settings to original default settings. Note that the advanced options are not affected.

Advanced Open a dialog with pre- and post- assembler settings. Optional command line sequences can be executed before assembling (pre) and after assembling (post).

Help Open the help page

Page 35: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Introduction The AVR GCC plug-in is a GUI front-end to GNU make and avr-gcc.

There is no compiler or make system included with the plug-in component; this must be downloaded

and installed separately. The plug-in requires GNU make and avr-gcc for basic

operations and avr-objdump from the AVR GNU binutils for generating list files.

To avoid problems setting up the build environment, it is recommended to install the WinAVR distribution

available at the WinAVR project's home page.

The plug-in component will automatically detect an installed WinAVR distribution and set up the required tools accordingly.

An AVR GCC plug-in project is a collection of source files and configurations.

A configuration is a set of options that specify how to build and link the files in a project.

On creating a new project, the "default" configuration is created.

A user can choose to continue using this configuration, adding/removing options as the project evolves or create one or

more new configurations to use in the project.

Requirements:

• WinAVR, or • GNU AVR tool-set. (avr-gcc.exe, make.exe and avr-objdump.exe)

Page 36: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Features Integration of avr-gcc and Make in AVR Studio

Start the compiler, clean the project, set project options and debug the project from AVR Studio.

Tools from the WinAVR distribution are detected by the plug-in.

GUI Controls to Manipulate Project Settings

Custom compile options can be set for specific files or all files in the project. Linker options can also be set.

There are controls for optimization level, include directories, libraries, memory segments and more.

A Project Tree for Managing Project Files

A project tree provides easy access to and manipulation of every file in the project. Work with Several Configurations

It is possible to define several sets of build options, called configurations.

Build Output

A build output view shows raw output from GNU make and avr-gcc.

Error and warning messages that contain reference to a file and line can be double-clicked to open this file

and put a marker on the line.

External Makefile

The plug-in allows the user to define a makefile to use for the build process.

NB: This approach has some limitations outlined in Using an external makefile

Page 37: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the

Map and List Files

Map and list files can be generated on each build.

External Dependencies

The plug-in keeps track of dependencies on libraries and header files that are not part of a project.

GNU Assembler projects

A user can set up and work with projects that consists of both assembly files (.s) and C files.

avr-gcc is used to assemble the .s files.

Page 38: Welcome to AVR Studio Studio.pdf · 2014. 5. 22. · 1) AVR Studio operates in different modes, edit and debug mode. The tool you add are only visible in the mode you are when the