3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to get started with Eclipse and AVR

How to get started with Eclipse and AVR
Programming AVRs is fun, but sometimes the manufacturers development environments make code maintenance a chore. If your looking for a free, cross platform, high quality piece of software for programming AVRs Eclipse is a good choice.

Moving to an Integrated Development Environment (IDE), such as Eclipse is a logical step up from learning to program basic functions. By using an IDE you will be able to work easier and work with a range of tools inside the same program. you will be able to easily package and reuse your code and you will have access to advanced functions like refactoring and code analysis. For details on these benefits please have a quick skim over Step 12: Quick Tour of Cool Features.

In this instructable I will show you how to install and configure Eclipse to program AVR micro controllers (aka. Micro Controller Units or MCUs). I will also provide a quick run through uploading to your MCU and I will briefly cover some of the cool feature Eclipse has to offer.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Why?

Eclipse is cool. Like, really cool. Compared to something like the Arduino programming software, the Eclipse IDE is the proverbial Swiss army knife.

For example, the Arduino development environment only lets you work in one file at a time. Also if you want to rename a variable you have to do a find/replace. If you want to take some code and wrap it in a method, you have to do it by hand. Eclipse can help with these otherwise tedious tasks and more. More generally speaking, moving to a fully featured IDE like eclipse is a step up from less full featured environments.

Note: Yes, Eclipse can be used to program the Arduino - however the set up for this is slightly more complex and the specifics of using Arduino in Eclipse will not be covered here.
« Previous StepDownload PDFView All StepsNext Step »
14 comments
Apr 16, 2012. 1:49 PMchypsylon says:
If I understood it correctly, activating the "Avrdude" setting here activates an automatic download to the avr on each build. I would recommend against setting this on, as you'd always have to have your programmer plugged in and the AVR powered on when you compile it.

Thanks for this great tutorial :)
Nov 23, 2011. 5:37 PMemihackr97 says:
Hi, I have a really BIG problem, the thing will just not work. The code is right, all the settings are right, everything is installed, everything in ON and plugged in, etc.
but when I try to upload it, it tell me that the project has not been built, I have in auto Build, but even when I do this manually I get the samemessage. it shows no errors anf in the console it just says "Nothing to Build" and it's not creating any Hex files. my code is this;

int main(void)
{
DDRB|= (1< while (1) {
PORTB &= ~(1< delay_ms(250);
PORTB|= (1< delay_ms(250);
}
return(0);
}

on a file called "main", PLZ PLZ PLZ help me! I've searched through all the web and found nothing helpful. :)
May 6, 2011. 5:54 PMquasipedia says:
Just wishing to drop a line saying that this tutorial is really cool. I have developed for a few months with Arduino, and when I switched to AVR I felt a bit "lost". The fact of being able to use the same IDE I use for normal work helps greately!

Cool! :)
Sep 19, 2010. 4:45 PMnvradeli says:
HI -

I am new to the AVR and starting out with an Arduino. I would like to expand beyond the Arduino environment, and have downloaded the datasheet and a couple of AVR tool sets onto my MAC. However, they don't seem to have much documentation included (I guess they assume everyone already knows the system from somewhere else). I'm fairly comfortable with C programming but not the AVR specific stuff. Can you suggest a good book/manual (hard cover or e-) that goes over the AVR libraries so I can understand how use them? I have started collecting example code to try learning that way but that leaves many questions.

Thank you for any direction you can give me.

nav
Sep 23, 2010. 11:56 PMMr Earl says:
I don't know exactly what you mean, but take a look at this:
http://www.nongnu.org/avr-libc/user-manual/index.html

i found it when i looked for a comfortable way to convert a byte input received by Serial.read into an integer.
There's no documented function in the Arduino libraries. However there is access to the standard libraries of avr (a subset of the C standard libraries) which contain the stdlib.h library (among other things) that provides an atoi function (ASCII to integer).

On the site you will find the supported microcontrollers, library documentation, information about the toolchain, etc.

did that help?
Sep 24, 2010. 5:49 AMchaotick says:

This is big help, thank you. I can handle C-code and its regular libraries fine, but it's hard to program interrupts, or even toggle a port pin, when you don't know the name of the library to #include, let alone what's in it. This should get me moving forward again. I really appreciate the direction.

RGRDS

nav
Oct 1, 2010. 3:40 PMchaotick says:


HI -

(If you get two replies, I apologise. Explorer is acting up)
See, I didn't even know ports are just read/written as variables. Cool. Thing is, I've been programming for a while but never cross-compiling or working with microcontrollers, so I don't really know enough to know what to ask. Thanks to your links, I now have an actual complete program, with #includes and all, to study. (so many articles out there only give you the 'interesting part' of the code, and assume you know what went around it). I'm going to try to build a program again this weekend. Thank you for your patience with me, and the good information.

RGRDS

nav
Sep 3, 2010. 1:47 AMMr Earl says:
Arduino Development in Eclipse sounds exciting for me as I am in fact programming with the arduino IDE at the moment. As I'm coding Java with Eclipse it would be a nice feature for me to have an one-for-all IDE. By the way: Great instructable.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
9
Followers
3
Author:andy(Thouton - Projects)
Andrew is a software engineer by trade and prefers projects that are simple yet effective. Andrew's areas of interest include software systems that do complex things from simple input, aesthetically p...
more »