AVR Z-LINKŪ
The first step to compile the TAT into your application with either the IAR or GCC compiler is to make a new project folder and copy the lib and inc folders here. Pre configured project files can be found in the examples folder for reference.
Note: In the reminder of this chapter it is assumed that you have AVR Studio and a valid copy of one of the two compilers installed.
Open IAR Embedded Workbench. Select New Workspace. Then select the Project menu and Create New Project...
The Create New Project will be visible. Select AVR as Tool chain. Choose the Empty project template and press OK. Save the Workspace and Project file to your project directory (Same level as inc and lib).
Select the Project menu again and Options. The Options window will be visible:
General Options:
Target tab: Processor configurations: Choose Processor configuration -cpu=m1281. Library Configuration tab: Library to Normal DLIB. System tab: Check the Enable bit definition... option.
C/C++ Compiler:
Preprocessor tab:
Additional include directories: write "$PROJ_DIR$\inc". Defined symbols: Add "AVR" and "F_CPU=8000000UL".
Linker:
Output tab:
Format: select other and Output format to "ubrof 8 (forced)". Do not alter anything else.
Extra Options tab:
Check Use command line options and add "-C $PROJ_DIR$\lib\avr\iar\tat_lib.r90".
Add the files in the src/avr to the project. Press F7 and verify that the code compiles without errors.
Open AVRStudio, the Welcome to AVR Studio 4 screen will appear. Select New Project.
In the Create new Project screen:
Select AVR GCC as project type and type in a project name.
Browse into your project folder where you already have two folders (inc and lib). Press next.
In the Select debug platform and device screen:
Select your Debug platform and ATmega1281 from the Device list. Press Finish.
In AVR Studio:
Select Project and Project Options from the drop down list. General Tab:
Verify that Device is ATmega1281. Set Frequency to 8000000 Hz. Set Optimization to -Os. Check Unsigned Chars, Unsigned Bitfields, PackStructure Members and Short Enums.
Include Directories Tab:
Add "inc" to the Include Search Path.
Libraries Tab:
Add "lib\avr\gcc" to the File Search Path. Verify that the Available Link Objects list have a member called "lib_tat.a". Select "libc.a" and "tat_lib.a" using the Add Library button. Press OK.
Select Project and Project Options again (Must be done to update the Custom Options List).
Custom Options Tab:
Add the following three options to your Custom Compilation Options window:
Press OK.
Add the files in the src to the project. Press F7 and verify that the code compiles.
@DOC_TITLE@
Generated on Wed Jul 25 21:15:50 2007 for AVR2001 Software Programmer's Manual by 1.4.7