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