avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Using AVR Tools


From: E. Weddington
Subject: Re: [avr-gcc-list] Using AVR Tools
Date: Wed, 21 Jan 2004 17:34:01 -0700

On 21 Jan 2004 at 9:38, ks_347 wrote:

> Hello,
> 
> I am new to AVR world.
> I have STK500 board and micro controller ATMEGA163.
> I am trying to setup this board and write some simple program, in which I can
> use the serial port. I know C, but I am not very familiar with how to write C
> code for embedded systems (Any good resources for this?) I have downloaded
> WINAVR and AVRStudio(latest version from Atmel)and I also went through some
> documentation regarding these tools. What I could figure out was that I could
> write the C code and make file using the Programmers Notepad. Then I can make
> the .coff file using PN and then open this file using the AVRStudio and I can
> simulate using this. I guess I can also write the hex file in the STK500 board
> using the AVRStudio. My questions are as follows: 
>1) Is this a good first step ?
> 2) Is this an ideal way to develop a complex system? Or mixing WINAVR and
> AVRStudio will creat problems? 
>3) Which are the topics, I should study in depth?

WinAVR is a software development toolset that contains compilers for C and C++, 
assembler, linker, utilities, programmers, debugger, editor, etc.

AVR Studio, only natively contains an assembler, but also has a simulator and 
programmer (with STK500 or AVRISP). AVR Studio has a GUI, natively.

Certain things can be mixed, and other things not. Yet other things have 
limitations. Note, especially, that Atmel's assembler is not compatible with 
GNU's assembler, as (a.k.a gas).

The WinAVR README.txt file discusses a lot of this already.


> Do I need to study the architecture/instruction sets of the micro controller 
in
> detail before I do all this? 

I would certainly recommend going over the datasheet of the desired device in 
detail, even going over it several times. I would also recommend that you at 
least be familiar with the instruction set; it always comes in handy.

You should at least determine whether you're going to program in assembler or a 
"higher" language like C.

> Is learning how to generate make files very
> crucial? 

Not crucial but it helps to be able to read a makefile and to get an idea of 
what's going on. WinAVR comes with a sample makefile that you can modify for 
your project. Alternatively, you can use MFile:
<http://www.sax.de/~joerg/mfile/>
which will help you generate a makefile for your project. The makefile template 
is based on the WinAVR sample makefile.
Take a look through the make user manual, it comes with WinAVR (and you can 
also find it online), say like the first 4-5 chapters. That will help you to 
read and get through makefiles.

>4) Do I have to create different make files each time I make a new .c
> file? 

Absolutely not. A makefile is, essentially, a list of instructions on how to 
build something, usually that something being a piece of software. As such, it 
contains all the information necessary (like a list of *all* the required 
source code files) to do this.

5) Where can I find more sample programs?

WinAVR comes with 2 examples programs. Look in the \examples directory. Each of 
these examples has their own makefiles (that are not based on the WinAVR 
sample).

Also, look on the AVR Freaks website, under the "Academy" tab. You can also ask 
around on the AVR GCC Forum there, as well.

HTH


reply via email to

[Prev in Thread] Current Thread [Next in Thread]