AVR Plugin for Eclipse (AVRFreaks Wiki)
OK I’m a new user on AVR Freaks but I have been reading a lot of articles in their forums and wiki this week. Since I just wrote my last post reviewing all the AVR IDE’s I’ve been using as I get my footing on this platform, I thought I’d help the Wiki by writing instructions on installing and using the AVR Plugin for Eclipse, since this seemed to be missing from the wiki.
View my instructions on the Wiki.
The first draft was a bit longer, but I accidentally browsed away from the page and lost my edit!! Doh!
No commentsAVR 8bit IDE’s (AVR Studio, VMLab, Eclipse) and FreeRTOS
This is kind of a review of sorts of a few items. Lately I’ve been trying to find efficient development tools to go with my AVR development board from Microelectronika. This board came with their MicroBasic IDE/Compiler, but it’s for Win32. Unfortunately the dev board is programmed via a proprietary USB interface so I need to fire up an old Windows box just to program the ATMega16 chip on it.
MikroBasic
I gave the MicroBasic IDE a work out when testing the development board features but found the language a little limiting for my taste, or maybe I’m just old-school. One example of what I didn’t like is that say the 1Wire library it used made use of a timer, which I didn’t know initially until I looked at the source, and that meant that I couldn’t use that timer for anything else, or combine it’s function with the 1Wire interface. Apart from that it’s a solid language and IDE for a beginner developing for this embedded system.
AVR Studio
The AVR chip can be used with the avr-gcc toolchain on Win32 and Linux. You’d know by know I’d prefer Linux but the first C hello world style program came up with compile/linker errors because I don’t code C very often and my Makefile vis a vis cross compiling skills were rusty. So I thought I’d get the basics down with some of the Win32 tools first. I really like the AVR 8bit chips as they are very open source friendly working with GCC and all.
Initially I installed AVR Studio 4 and the WinAVR toolchain. The AVR Studio IDE is straightforward, as is the simulation interface for testing/debugging. It’s plain but it works. I like how you can see the chip internals as the simulation runs (slowly).
VMLab
As I was looking up some information I found a link to VMLab, another free IDE that showed more promise in the simulation department. In fact it was pretty good to start with. Not only could you get debug output of things like chip registers, but also C source variable watching. Then the tasty treat.
In the project file, you can define the circuit you are connecting the ATMega chip to just like a little SPICE circuit to add things like switches, LEDs, LCDs, Serial TTY’s among other things. Woah this was GOOD! The code editiing features were reasonable and plain as well, but I prefer the window docking/layout features of AVR Studio rather than the old style MVP(?) win32 application layout.
Here’s an example of adding a TTY (Serial) to the AVR program I was simulating. Easy, huh?
; Micro nodes: RESET, AREF, PA0-PA7, PB0-PB7, PC0-PC7, PD0-PD7, ACO, TIM1OVF
; Define here the hardware around the micro
; ————————————————————X1Â TTY(38400 8 0 0 1 1) PD0 PD1
The code editor didn’t do any code highlighting in .h files, only .c files which led me back to AVR Studio for a while. I was developing bits of the BeerReg2 program in VMLAB as separate mini-projects and then when they worked in simulation moving them into the main BeerReg2 in AVR Studio when I noticed something strange.
For about an hour my code would compile fine in AVR Studio, but would not work as intended when programmed to the development board. This was quite frustrating as in simulation it worked fine, but only half of the program worked properly on hardware. Then I compiled with VMLab and loaded the hex file on the board and found the same code worked properly in simulation and hardware! There was obviously something different between the two make processes in the two IDEs. Finally I had a reason to look, not for the reason, but another solution…
Eclipse
I have been doing much of my coding on other projects using the Eclipse IDE on my Linux workstation. It handles C/C++, Python, and many other languages very well. I like it a lot. I like the fact you can add functionality by downloading and installing new modules. First I got the PyDev module to handle Python code, then I added the Subclipse module so it integrated my Subversion source control seamlessly. It’s interface is very intuitive.
As I was researching some avr-gcc things along the way I found an article about using WinAVR with Eclipse and so followed these instructions. Then I found they were a bit dated and the Eclipse UI had changed since it was written, so I found someone had written an AVR Plugin for Eclipse. Bingo!
After reading the instructions and installing the plugin on an Eclipse/Win32 setup I found I could not follow some of the instructions for some reason (I can’t recall). I was about to give up when I went back to my Linux desktop and it’s Eclipse installation. I installed the AVR Plugin through the Eclipse update system and installed the AVR toolchain and related packages that Ubuntu carries in its repositories.
BAM! Opening a new C Project gave me the option to build a AVR cross compiled application! Then I copied in my code from another project, the syntax highlighting showed me an obvious mistake I had made within seconds, and Eclipse was set to build automatically which meant that syntax errors were also pointed out to me with glaring obviousness! I had found my AVR IDE, and it’s the IDE I’ve been using for several months already.
However the Eclipse IDE doesn’t have Simulation/Debugging capabilities that VMLab/AVRStudio has. That doesn’t worry me too much because I am much more comfortable with this environment and I just load the .hex files built with Eclipse/avr-gcc to the development board and test on real hardware much faster than simulating in a slow emulated environment. Shortly I think I’ll be looking at some of the AVR packages I installed from the Ubuntu repositories like simulavr may cover any simulation requirements I may need.
Microelectronika EasyAVR/USB Programmer
This means I’m developing for my favourite embedded chips, AVR, on my favourite desktop environment, Ubuntu Linux. The only step not taken is the programmer which uses a proprietary USB interface to program the development board. I’ll fix this issue soon as well, either by wiring up a simple parallel/serial programmer and plug it in to the appropriate pins on the development board (therefore bypassing the USB interface all together) or some other hack (RE anyone?).
I looked at the Microelectronika forums about Linux support for the EasyAVR boards, and found some requests for it with answers saying they were looking into Linux support with more information coming ’soon’. But these were posts from 2005 and 2006 and 2007. Thinking about it, this company has no interest supporting Linux since they want you to buy their MicroBasic or MicroPascal compilers rather than develop in C using free open source software. So I doubt they will really ‘finish’ their port of the programmer to Linux any time soon.
FreeRTOS
More of a footnote really. Again, as I was wading my way through some AVR forums at places like AVRFreaks and WinAVR.Scienceprog.com, I found a PDF about multitasking on the AVR 8 bit, using FreeRTOS, a GPL’d real time scheduler. The demo application included in the source was for an ATMega323, which is now been replaced by the ATMega32. Looking at my development board, I think I can replace the ATMega16 on it with the ATMega32, and also change the crystal to 20MHz from it’s current 8MHz. VERY VERY COOL.
I’ve taken a look of the code for RTOS to get a feel for it, and I am very impressed so far. I compiled the demo application in AVR Studio/WinAVR so I could try it in simulation, and I already have some project ideas scribbled on my notepad to look into. So, expect some RTOS review or project on this site in the near future.
No comments
![[del.icio.us]](http://www.scriptforge.org/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.scriptforge.org/wp-content/plugins/bookmarkify/digg.png)
![[Google]](http://www.scriptforge.org/wp-content/plugins/bookmarkify/google.png)
![[Technorati]](http://www.scriptforge.org/wp-content/plugins/bookmarkify/technorati.png)
![[Yahoo!]](http://www.scriptforge.org/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.scriptforge.org/wp-content/plugins/bookmarkify/email.png)