?lang_form? ?lang_select? ?lang_submit? ?lang_endform?
{HEADER END}
{BLAME START}

library

?curdirlinks? -

Blame information for rev 6

Line No. Rev Author Line
1 6 kaklik /** \page install Installing AVRlib Manually
2  
3 \htmlonly
4  
5 <h2>Sections</h2>
6 <ol>
7 <li><a href="#1">Overview</a></li>
8 <li><a href="#2">Downloading</a></li>
9 <li><a href="#3">Installing</a></li>
10 <li><a href="#4">Testing</a></li>
11 </ol>
12 <br>
13  
14 <p><strong><font color="#FF0000">
15 This guide applies only to manually "installing" the AVRlib zip file.
16 If you are using a windows machine, you may use the AVRlib win32 installer program.
17 These steps are done automatically by the installer.
18 </font></strong></p>
19  
20  
21 <hr>
22 <h3><a name="1"></a>1. Overview</h3>
23 <blockquote>
24 <p>Procyon AVRlib is an open-source collection of C-language function libraries
25 for the Atmel AVR series processors. The goal of AVRlib is to provide the
26 programmer with a code base which performs the most often needed tasks in
27 embedded system programming. Hopefully, this will allow the programmer to
28 focus on high-level operation of their code rather than get bogged down in
29 the details of low-level code.</p>
30 <p>In short, AVRlib is a bunch of functions that do things commonly needed in
31 embedded systems. Despite the learning curve of getting started, for most
32 projects, using AVRlib will shorten the time spent programming and/or improve
33 the quality or functionality of the final product.</p>
34 <p>AVRlib functions are available for a wide variety of tasks and purposes.
35 In general, AVRlib tries to address the following kinds of needs:</p>
36 <ul>
37 <li>Functions which control or interface to AVR processor hardware (like timers,
38 uarts, the a2d converter, etc)</li>
39 <li>Functions which interface to or drive devices often used in embedded systems
40 (like LCDs, hard disks, gps units, etc)</li>
41 <li>Functions which create higher-level functionality from processor resources
42 (like pulse generation, software uarts, software i2c bus, etc)</li>
43 </ul>
44 <p>For a partial list of currently available function libraries see the <a href="index.html">AVRlib
45 Main Page</a>.</p>
46 </blockquote>
47 <h3><a name="2"></a>2. Downloading</h3>
48 <blockquote>
49 <p>AVRlib is currently available as a win32 self-installer, or a zip file.
50 Both are available from the <a href="index.html">AVRlib Main Page</a>.</p>
51 </blockquote>
52 <h3><a name="3"></a>3. Installing</h3>
53 <blockquote>
54 <p><strong><font color="#FF0000">This installation for AVRlib assumes you have
55 already installed the AVR-GCC or WinAVR compiler and successfully tested it.</font></strong></p>
56 <p>You can install AVRlib anywhere you like, however, it's suggested that you
57 install it in a directory alongside your own AVR code projects. Create or
58 choose a top-level directory to hold both AVRlib and the project folders which
59 you will create to hold the code for each individual project you work on.
60 The directory you choose should not contain spaces in its name or path. Some
61 examples are: </p>
62 <pre>
63 c:\Code\AVR <font color="#009900">(GOOD)</font>
64 c:\My Code <font color="#FF0000">(NOT RECOMMENDED - HAS SPACES IN PATH)</font>
65 </pre>
66 <p>From the download step you should have an <strong>avrlib.zip</strong> file.
67 Unzip this file into the code directory you chose above. Be sure to preserve
68 the internal directory structure of the zip file when you unzip it. Afterward,
69 you can delete avrlib.zip but you may want to keep it for later re-installs
70 or as a backup.</p>
71 <p>You should now have an <strong>avrlib</strong> directory where you installed
72 AVRlib. If you have some time, get familiar with what's inside some of the
73 directories. Your directories should look something like this:</p>
74 <pre>
75 c:\Code\AVR\avrlib <font color="#0000FF"><-- AVRlib header and code files</font>
76 c:\Code\AVR\avrlib\conf <font color="#0000FF"><-- AVRlib template configuration files</font>
77 c:\Code\AVR\avrlib\docs <font color="#0000FF"><-- AVRlib documentation</font>
78 c:\Code\AVR\avrlib\examples <font color="#0000FF"><-- AVRlib example applications</font>
79 c:\Code\AVR\avrlib\make <font color="#0000FF"><-- AVRlib makefile include (avrproj_make file in here)</font></pre>
80 <p>Finally, you need to create an environment variable <strong>AVRLIB</strong>
81 which points to the directory where you &quot;installed&quot; or unzipped
82 the AVRlib files so the compiler can find them. An example might be:</p>
83 <pre>AVRLIB = c:/code/avr/avrlib <font color="#0000FF"><-- change to actual AVRlib install directory</font>
84 </pre>
85 <p>If you are unsure how to set environment variables on your system, look at
86 the WinAVR/AVR-GCC installation guide elsewhere on this site or consult the
87 web.</p>
88 <p>AVRlib installation is complete!</p>
89 </blockquote>
90 <h3><a name="4"></a>4. Testing</h3>
91 <blockquote>
92 <p>There are a few simple steps you can take to verify that AVRlib is properly
93 installed:<br>
94 <font color="#FF0000"><strong>(This assumes you have previously installed
95 and tested the AVR-GCC or WinAVR compiler)</strong></font></p>
96 <ul>
97 <li>Open a Command Prompt (find it in your <strong>Start Menu</strong> or
98 select <strong>Run</strong>, and run <strong>cmd.exe</strong>) </li>
99 <li>Change directories to the location where you installed AVRlib. For example:<br>
100 <strong>cd c:\Code\AVR\AVRlib</strong></li>
101 <li>Go into the examples directory. <strong>cd examples</strong></li>
102 <li>Pick an example to try compiling such as rprintf and change to that directory.
103 <strong>cd rprintf</strong></li>
104 <li>Type <strong>make clean</strong> at the prompt</li>
105 <li>Type <strong>make</strong></li>
106 <li>If your output looked like this then you just compiled your first AVRlib
107 program:
108 <pre>
109 C:\Code\AVR\avrlib\examples\rprintf>make
110 avr-gcc -c -g -Os -Wall -Wstrict-prototypes -Ic:/code/avr/avrlib -Wa,-ahlms=rpri
111 ntftest.lst -mmcu=atmega323 -I. rprintftest.c -o rprintftest.o
112 avr-gcc -c -g -Os -Wall -Wstrict-prototypes -Ic:/code/avr/avrlib -Wa,-ahlms=c:/c
113 ode/avr/avrlib/buffer.lst -mmcu=atmega323 -I. c:/code/avr/avrlib/buffer.c -o c:/
114 code/avr/avrlib/buffer.o
115 avr-gcc -c -g -Os -Wall -Wstrict-prototypes -Ic:/code/avr/avrlib -Wa,-ahlms=c:/c
116 ode/avr/avrlib/uart.lst -mmcu=atmega323 -I. c:/code/avr/avrlib/uart.c -o c:/code
117 /avr/avrlib/uart.o
118 avr-gcc -c -g -Os -Wall -Wstrict-prototypes -Ic:/code/avr/avrlib -Wa,-ahlms=c:/c
119 ode/avr/avrlib/rprintf.lst -mmcu=atmega323 -I. c:/code/avr/avrlib/rprintf.c -o c
120 :/code/avr/avrlib/rprintf.o
121 avr-gcc -c -g -Os -Wall -Wstrict-prototypes -Ic:/code/avr/avrlib -Wa,-ahlms=c:/c
122 ode/avr/avrlib/timer.lst -mmcu=atmega323 -I. c:/code/avr/avrlib/timer.c -o c:/co
123 de/avr/avrlib/timer.o
124 avr-gcc -c -g -Os -Wall -Wstrict-prototypes -Ic:/code/avr/avrlib -Wa,-ahlms=c:/c
125 ode/avr/avrlib/vt100.lst -mmcu=atmega323 -I. c:/code/avr/avrlib/vt100.c -o c:/co
126 de/avr/avrlib/vt100.o
127 avr-gcc c:/code/avr/avrlib/buffer.o c:/code/avr/avrlib/uart.o c:/code/avr/avrli
128 b/rprintf.o c:/code/avr/avrlib/timer.o c:/code/avr/avrlib/vt100.o rprintftest.o
129 -Wl,-Map=rprintftest.map,--cref -mmcu=atmega323 -o rprintftest.elf
130 avr-objcopy -O ihex -R .eeprom rprintftest.elf rprintftest.hex
131 avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section
132 -lma .eeprom=0 -O ihex rprintftest.elf rprintftest.eep
133 avr-size rprintftest.elf
134 text data bss dec hex filename
135 9596 0 192 9788 263c rprintftest.elf
136 Errors: none
137 rm c:/code/avr/avrlib/vt100.o c:/code/avr/avrlib/rprintf.o c:/code/avr/avrlib/ua
138 rt.o c:/code/avr/avrlib/timer.o c:/code/avr/avrlib/buffer.o
139  
140 C:\Code\AVR\avrlib\examples\rprintf>
141 </pre>
142 </li>
143 <strong>AVRlib is ready to use!</strong>
144 </ul>
145 </blockquote>
146 <hr>
147 <center>Written by Pascal Stang | Updated:
148 <!--#echo var="LAST_MODIFIED" -->
149 </center>
150 </body>
151 </html>
152  
153 \endhtmlonly
154  
155 */
{BLAME END}
{FOOTER START}

Powered by WebSVN v2.8.3