~Linus Torvalds
Electronics geeks all around the world are rapidly moving toward Linux based free tools for their development work. Most of the newbies find it difficult to switch fully to linux as the lack of availability of window counterpart tools in linux.
Here i am giving you an idea how to start AVR development while you are using some Linux distro as your OS. Now a days UBUNTU is one of the most popular Linux distro for beginners because it is very easy to use, and most of the necessary tools are packed with the distro.
Here i am describing how to write a program, compile a program and burn the AVR in UBUNTU. I checked this procedure on UBUNTU Desktop edition 8.10(previously) and 11.04 it should be compatible with others also but i didnt try. So lets start your embedded world with avr on Linux too
To start with AVR development on linux you need following four packages.
The whole installation procedure is explained in this Tutorial, but first let me explain you what these above 4 packages actually are;
avr-gcc is the C cross compiler for AVR which generates
avr-binutils- The binutils package provides all the low-level utilities needed in building and manipulating object files. Once installed, your environment will have an AVR assembler (avr-as), linker (avr-ld), and librarian (avr-ar and avr-ranlib). In addition, you get tools which extract data from object files (avr-objcopy), dissassemble object file information (avr-objdump), and strip information from object files (avr-strip). Before we can build the C compiler, these tools need to be in place.
avr-libc- it is the satndard function used while programming for AVR in C. It consistes of header files for utilizing the features of AVR like Interrupts, EEPROM, I2C, SPI, UART etc. For more info go to AVR-libc home http://www.nongnu.org/avr-libc/
avr-dude- AVR-DUDE is an open source utility to download/upload/manipulate the ROM and EEPROM contents of AVR microcontrollers using the in-system programming technique (ISP). For more info try this : http://www.nongnu.org/avrdude/
That is all about what AVR specific tools you need to do your stuff, but first thing you need is some editor where you can type your code. I use gEdit as a text editor on my machine.In all new releases of Ubuntu its already there with distribution otherwise Below is the command to install gEdit.
These days all Linux distribution has one or other Text editor already installed. All new versions of Ubuntu has gEdit editor. In case you don't have gEdit install you can install it by typing in the following command in a terminal window.
Or you can use Ubuntu software center to install it directly over there. Once gEdit is installed you can start it by typing gedit on terminal.
To make it more easy to use we can add some more plug-in with our gEdit installation, one very useful plug in is embedded terminal which allows us to use terminal window embedded with gEdit in bottom pane of the editor. To install gEdit plug-in issue following command in a terminal.
follow these steps to show terminal in the bottom pane of gEdit window.