AVR Robot Controller 1.1 Software Tools
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 are using an AVRISP via a serial (or USB) port, you will need to open the “makefile” file in the “01a FlashLED” folder and change two definitions: “AVRDUDE_PROGRAMMER = avrisp” and “AVRDUDE_PORT = com1”. You may also want to define environment variables for these.)
In Programmers Notepad, use File/Open to open FlashLED.c in the “01a FlashLED” folder (in C Samples). In the Tools menu, choose the “Make All” option. An “output” window will show the results of your build. (If you get a message that “the system cannot find the file specified,” you probably just need to restart Programmers Notepad using LaunchPN.bat.) To download the program, turn on power to the ARC board, then from the Tools menu, choose the “Program” option.
You should now see the green LED flash with a
avr-gcc on Mac OS X
The easiest option for programming on the Mac is to use the C compiler and UISP downloader available via a package installer from http://www.eecs.berkeley.edu/~mseeman/resources/macmicro.html. It’s an easy install process, but only compiles C, not C++, programs.
If you would like to use C++, you’ll need to do a full manual install (building all of the tools from source). Fortunately, there are complete instructions in the AVR runtime library manual
Note: The AVR runtime library manual mentioned in the previous paragraph contains lots of useful information for programming the Atmel ATmega processors, making it a good resource regardless of which compiler option you choose.
Using these tools requires using the command line interface to the Mac’s
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.
While power to the ARC board is off, plug the AVRISP device into the ISP header on the board and connect it to a
In the Terminal window, change to the “01a FlashLED” folder. At the command line type “make” to compile the program. Turn on power to the ARC board, then type “make program” to download the program.
You should now see the green LED flash with a
Customizing the Microcontroller
The ATmega16 microcontroller provided in the kit can be customized by changing “fuse bits.” These settings may be modified with built in programmer that comes with BASCOM, or with the AVRDUDE program included in the WinAVR suite.
Every fuse bit has a default value. There are several fuse states that it’s useful to change. These are explained in more detail in the “ATmega16 Overview” section. The suggested changes are: (1) set the internal oscillator (clock)
12 |