Robots are all about adding intelligence to your machines and make your microcontroller regulate as you please. However the microcontroller does not understand what you say, or can you understand what it wants. These thingy’s can understand what is called the binary or machine language. Hence we need to use certain tools to convert human understandable language to machine understandable language. To program a microcontroller, we write a neat program in C and compile it to create a standard hex file, and later upload the hex file into the microcontroller.
We will use Atmel AVR series microcontroller to create almost all robots in this site, which will be developed on a windows platform. So, we need to install windows specific compiler. Instead of installing all bits and pieces of software, we will install a package which includes the following:
- GNU Binutils: Binary utilities for AVR target (includes assembler, linker, etc.)
- AVR GNU Compiler Collection (GCC)
- Collection of C Standard Libraries for AVR
- Avrdude: Open source programmer software
- Programmer’s notepad
- GNU Debugger and many more...
This package is an executable, open source software development tool called WinAVR . You can download the software and user manual at winavr.sourceforge.net. There is also a portable version of WinAVR available. Although I have not tried using the portable version, you can use it and share your experience in the forum.
Now you have a compiler to compile your code and ready to start coding. However to ease the development and debugging, you have another free software provided by Atmel, which is AVR Studio. This is an integrated development environment (IDE) which has compiler, source code editor, debugger and other conveniences incorporated. You can download the latest version from Atmel along with three available service packs (at the time or writing this tutorial). Thanks to Atmel for being generous enough to provide this IDE.
For some reason Atmel requires you to register in their site and provide your name, address, phone number along with other details to download the software. Unless you have an other choice, please register and download the IDE with following Service packs.
AVR Studio 4.18 (build 684)(116 MB) AVR Studio 4.18 SP1 (build 692) (28 MB) AVR Studio 4.18 SP2 (b700)(28 MB) AVR Studio 4.18 SP3 (b716)(31 MB)
Atmel has released a latest version which combines installer with all the service packs. You will find a list of AVR Studio software in the link below. Download the most recent one which generally will have all patches updated.
There is also another IDE (integrated development environment) for developing both Atmel ARM and Atmel AVR microcontroller based applications. If you are keen to install this newer version, download Atmel Studio from link below. However, note that the tutorial in the next few pages shows installation of AVR Studio. If you are installing Atmel Studio, just follow installation instructions while installing the package.
Once we compile our program with AVRStudio, we need to upload the generated .hex file into the microcontroller. For this we use another free software, distributed under the terms of the GNU General Public License: PonyProg which is powerful programmer software that helps us in reading and writing hex file into AVR microcontroller and other serial devices (visit site for more information). Download the windows version of PonyProg.
Once you have downloaded these software, install them exactly in the sequence mentioned below:
- AVR Studio
Now that you are done with installing all required software, the next part is the hardware part. Although this does not come under the software requirement category, to upload your code into a microcontroller you need a programmer which acts as an interface between the microcontroller and your computer. You can purchase a programmer from Atmel called the AVR ISP, or from any other vendor, or you can even build your own programmer.
By now you are aware of the requirements, software required for writing, editing, debugging, and compiling your code, and a programmer to help you upload the code to your microcontroller.
If the above information is sufficient, you can skip rest of the pages and start with the installation. Next few pages contain detailed instructions on installation with screenshots, and also instructions on how to configure them.