SRS Labs SRS Robot Level 1 Kit Robotics User Manual


 
AVR Robot Controller 1.1 Software Tools
Tool Options
Free, high-quality tools are available for the Atmel AVR series of microcontrollers. On Windows systems, two
popular options are the BASCOM (BASIC) compiler and the WinAVR suite of tools for C/C++ programming. Mac
OS X supports the avr-gcc C/C++ compiler (which should work equally well on Linux and FreeBSD).
The following sections each provide instructions for installing a compiler and downloading a simple program to
your ARC board. Choose the option that best suits your needs and follow the steps in that section.
BASCOM on Windows
BASCOM-AVR is an “integrated development environment” (IDE) that provides an editor, BASIC compiler, and
downloader. This is a good starting point for people new to programming.
You can download the BASCOM-AVR DEMO from http://www.mcselec.com. This site also provides information
on installing BASCOM.
Copy the “BASCOM Samples” folder from http://www.seattlerobotics.org/WorkshopRobot/Level1/
(or the
Workshop CD’s “Samples” folder) to a convenient place on your hard drive.
Start the BASCOM-AVR program. Use File/Open to open FlashLED.bas in the “01aFlashLed” folder (in BASCOM
Samples).
While power to the ARC board is off, plug the programming cable into the ISP header on the board and the parallel
(printer) port of a PC. (If you have an AVRISP or STK200/300 compatible programming cable you can use that
with BASCOM by changing the programmer in the Options/Programmer menu. (The kit’s programmer uses the
default “Sample Electronics programmer” option.) Please refer to the BASCOM documentation for additional
information.)
Turn on power to the ARC board, click on the Compile button (or use menu Program/Compile), then click on the
Run button (Program/Send To Chip). The Sample programmer should pop up with the ARC CPU identity listed
(m16). Click on the Auto-Program button (menu: Chip/Autoprogram) and the program should load in a couple
seconds. Close the Sample programmer window.
The green program LED flashes with a one second cycle time after a successful download. If the LED flashes very
slowly, then the oscillator options for the CPU have not been set and the CPU is likely running off the factory
default 1 MHz internal oscillator. You can re-program the chip to run off the external crystal/resonator, or the
internal 8 MHz oscillator by reading about the fuse bits and programming them appropriately. See “Customizing the
Microcontroller” below.
WinAVR (avr-gcc) on Windows
WinAVR (pronounced “whenever”) is a suite of software development tools for the Atmel AVR series of
microprocessors. It includes the avr-gcc compiler for C and C++, AVRDUDE downloader, and Programmers
Notepad editor.
You can download the WinAVR suite from http://sourceforge.net/projects/winavr/
. When you run the installer, it is
a good idea to uncheck the option “Add Directories to PATH.” (Adding the WinAVR tools to the path may cause
grief for other apps since that puts Cygwin (Linux emulation) files before system files.)
If you are using an “NT” version of Windows (e.g. NT 4.0, 2000, XP, 2003), you will need to do the following to set
up AVRDUDE (it enables communication with the ports needed for downloading):
Launch a Command Prompt (from the Programs menu, choose Accessories, then Command Prompt).
At the prompt, type:
cd c:\WinAVR\bin and hit Enter
Then type:
install_giveio and hit Enter
You should see output from this program, ending with a “Success” message. Close the command prompt window.
Copy the “C Samples” folder from http://www.seattlerobotics.org/WorkshopRobot/Level1/
(or the Workshop CD’s
“Samples” folder) to a convenient place on your hard drive.
11-3-2005 11