DIY mechanics and electronics projects

DIY mechanics and electronics projects

Google Search

WebThis site

Buy me a Beer :)

This web page is run by me on my spare time. If you find any of the information useful and worth a couple of bucks, I will be very grateful if you buy me a beer by donating a small amount using the PayPal link below :)

Amount: 

Quick-start on AVR and GCC Print E-mail
User Rating: / 1
PoorBest 
Article Index
Quick-start on AVR and GCC
Writing code
AVR simulator
Device Programming
All Pages

avrstudioWhen I started using the AVR micro controllers back in 1999, I coded most of my applications in assembly. After a while GCC for AVR became available, and now, with the integration of GCC support in Atmels AVR studio, starting with GCC for the AVRs is now as easy as coding in assembly.

I will show you how to make a simple C project from scratch using AVR studio and GCC. Hopefully this will inspire some of you to move from assembly language and into the convenience of coding in C.

Step 1: Installation

First you must download and install the winAVR package for Windows. This is a AVR GCC distribution that enables easy integration between GCC and AVR studio. Then download and install the latest version of AVRStudio with the latest service packs. You are now ready to start.

Step 2: Creating a project

Start AVR studio. It will start its project wizard. Click on "New Project"

project wizard

In the next window select AVR GCC as Project Type. Name your project, and select wether or not you want AVR studio to create the initial file for you, and a folder for the project.Press Next >>.

Project details

Select which debugging target you would like to use. Note that tools as STK500, STK600, AVRISP etc are not listed as they only provide programming support, and no debug support. If you do not have any debuggers you should select AVR Simulator or AVR simulator 2. Only devices supported by the selected debug target will be possible to select. The unsupported devices will be grayed. AVR simulator 2 is Atmels newest simulator and should be selected if your device is supported.

debug target selection

Here I have selected the new ATxmega128A1 XMEGA device. Press finish, and your project files will be generated.



 
 
Joomla 1.5 Templates by Joomlashack