Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Setup AVR Eclipse plugin to work with WinAVR

Probably many of you (including me) are using Programmers Notepad or AVR Studio to set up AVR projects. Each of them has advantages and disadvantages. For instance Programmers Notepad is great GUI, but there are lots of manual routines required to start compiling project – like setting up makefile, creating file dependencies, etc. AVR Studio is a great solution which generates makefiles automatically, and it has great simulator for immediate debugging. So why would we need another IDE? Actually Eclipse IDE is one of the best open source tools hat is widely used by programmers – so it is optimized for managing projects, code writing with auto-complete functionality. So why not to give a try for it.


So lets set up Eclipse environment to work with AVR. Firs of all lets download Eclipse from https://www.eclipse.org/downloads/ site. Choose Eclipse IDE for C/C++ Developers as we want program AVR in C. Open it (no need to install) then go to HELP->Install New Software… Click Add… and in the Add Site dialogue box enter URL where AVR Eclipse plugin is located (https://avr-eclipse.sourceforge.net/updatesite/ )


After confirmation you should see AVR Eclipse Plugin ready to download in details area:


Click next and then accept term of license agreement to start download.


After plugin is downloaded you will need to restart Eclipse to make it working.

If you already have WinAVR on your machine, you can start new project. For this Go to File->New->C Project. Select Empty Project in AVR Cross Target Aplications and enter Project name which also serves as new project folder in desired location..


After pressing Next you will have to select configurations weather you want to debug or generate hex file. Lets leave both (debug and release) configurations selected.


Click Next… and then select Microcontroller and its working frequency.


So your project is set up you can start writing program for your AVR. Simply go to File->New->Source File to add blanc C file like main.c where your program will be stored. This way you can add more files to project tree. If you have some independent library files – just upload them to project directory and dependencies will be generated automatically.


If you have some program ready to run, next will be to build a project and flash the chip with some programming tool.

To build project just go to Project menu and select Build All.

I have used usbasp adapter that works well with avrdude, Go to menu Project->Properties then go to AVR->AVRDude. Here you can select programmer type, fuse settings, lockbits and other features that are supported by adapter. To select programmer type click New near Programmer configuration. In a new window you will be given all list of programmer hardware supported by avrdude. For usbasp just select USBasp, https://www.fischl.de/usbasp/ and press OK.

To start uploading firmware go to menu AVR and select Upload Project To Target Device. And you should see AvrDude action in console tab:


If you are familiar with WinAVR and AVR Studio combination, starting to work with eclipse should be intuitively easy.

One great feature of AVR Eclipse Plugin is Fuse and Lockbits settings. It has great interface for fuse selection. Here you can select various ways of setting AVR fuses including leaving as it is, loading fuse settings from file and direct setting. All fuse settings you can see in Fuse preview window while editing. This is really handy to double check values before uploading to chip.


Editing of direct values has couple really valuable features. One of them is Load from MCU – which loads current fuse settings from chip. And another is Fuse editor. Which offers visual fuse setting interface.


This allows no messing with hex numbers and you are really sure what you’ve selected. Wee all know that AVR fuse settings probably are most complicated part for AVR starters and not only…

Over all AVR eclipse plugin offers really nice interface for complete project development. You say it has no simulator or debugger. Eclipse itself doesn’t, but WinAVR has. You can configure Eclipse to use SimulAVR tool to simulate project or AVaRICE to debug via JTAG interface. Thumbs up to this great tool.

Of course it is impossible to cover all features AVR Eclipse Plugin offers. All information and support you can get at AVR_Eclipse_Plugin site.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.