Position: Index > Unclassified >

Setup AVR Eclipse plugin to work with WinAVR

2017-11-22 06:58  
Declaration:We aim to transmit more information by carrying articles . We will delete it soon, if we are involved in the problems of article content ,copyright or other problems.

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.

avr_eclipse

So lets set up Eclipse environment to work with AVR. Firs of all lets download Eclipse from http://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 toHELP->Install New Software…ClickAdd…and in theAdd Sitedialogue box enter URL where AVR Eclipse plugin is located (http://avr-eclipse.sourceforge.net/updatesite/ )

add_new_site_to_eclipse

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

eclipse_plugin_ready_to_download

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

eclipse_plugin_downloading

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 toFile->New->C Project. SelectEmpty ProjectinAVR Cross Target Aplicationsand enterProject namewhich also serves as new project folder in desired location..

start_new_AVR_project_with_eclipse

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

new_AVR_project_configuration_in_eclipse

ClickNext… and then select Microcontroller and its working frequency.

select_mcu

So your project is set up you can start writing program for your AVR. Simply go toFile->New->Source Fileto 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.

eclipse_project_files

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 toProjectmenu and selectBuild All.

I have used usbasp adapter that works well with avrdude, Go to menuProject->Propertiesthen go toAVR->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, http://www.fischl.de/usbasp/ and press OK.

To start uploading firmware go to menuAVRand selectUpload Project To Target Device. And you should see AvrDude action in console tab:

avrdude_eclipse

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.

avrdude_eclipse_fuse

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.

avrdude_eclipse_fuse_GUI

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 orAVaRICEto 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.


Reprinted Url Of This Article:
http://www.scienceprog.com/setup-avr-eclipse-plugin-to-work-with-winavr/