This software package also contains the installation files for the Pololu SLO-scope
application for Windows. Please see
for installation and usage instructions.
3.b. Programming AVRs Using AVR Studio
After you’ve installed the necessary drivers, the next step is to download and install a
compiler.
[http://winavr.sourceforge.net/]
is an open source suite of software
development tools for the Atmel AVR series of microcontrollers. It includes the GNU GCC
compiler for C and C++. Please follow the installation instructions they provide.
WinAVR alone will give you all the tools you need to start programming AVRs with the
USB AVR programmer, but Atmel offers
[http://www.atmel.com/avrstudio/]
, a free
integrated development environment (IDE) designed to work with the WinAVR GCC C/C++
compiler. AVR Studio includes a simulator and other useful tools, and supports the AVR
ISP protocol used by the Orangutan USB programmer. Please follow Atmel’s installation
instructions. Note that newer versions of AVR Studio might not work with older versions of
WinAVR, so we recommend you upgrade to the newest version WinAVR every time you get a
new version of AVR Studio.
The following tutorial covers the steps needed to program AVRs using AVR Studio and
a Pololu USB AVR programmer. Specifically, we will write a simple program to blink
an LED connected to pin PD1 of an AVR. On any of the Orangutan
[http://www.pololu.com/catalog/category/8]
and
the
[http://www.pololu.com/catalog/product/975]
, this program will blink the red user LED. If
you want to program an AVR that does not have an LED connected to pin PD1, the LED-
blinker code in this tutorial will have no visible effect.
If you have an Orangutan or 3pi and want to jump straight in to using your USB AVR
programmer, you can skip steps 1-3 by downloading the AVR Studio project these steps
would create. Determine the microcontroller on your device, download the corresponding
file below, extract all the files to a directory, open the AVR Studio project file (BlinkLED.aps),
and proceed to step 4.
• mega48:
[http://www.pololu.com/file/download/
BlinkLED_m48.zip?file_id=0J188]
(9k zip)
• mega168:
[http://www.pololu.com/file/download/
BlinkLED_m168.zip?file_id=0J189]
(9k zip)
• mega328:
[http://www.pololu.com/file/download/
BlinkLED_m328.zip?file_id=0J190]
(9k zip)
1.
Open AVR Studio and click
New Project
. Select
AVR GCC
for the project type. Enter
the project name and initial file name. In the screenshot below, we named our project
“BlinkLED” and elected to have a folder called “C:\BlinkLED” created containing the
blank file “BlinkLED.c”. Click
Next >>
. DO NOT click “Finish” yet. If you do accidentally
click “Finish”, you will not be able to perform step 2 and will instead have to set the
device by going to the “Project” menu and selecting “Configuration Options”.
Pololu USB AVR Programmer User's Guide
© 2001–2010 Pololu Corporation
3. Getting Started in Windows
Page 11 of 36