EsotericAlgorithm's Blog

Random Hobbies and Whims

Eclipse and the AVR Toolchain

leave a comment »

Success. I have finally figured out how to program an AVR chip using the toolchain and an iscp. The first issue that I was having was a permissions issue as the device was not given access permission so I had to sudo every command. Not a problem initially but it became a problem once I began using Eclipse. In order to solve the problem I stayed up late hacking away. I pinpointed it down to needing to set a rule for udev. Eventually I solved the problem. Out of curiosity I searched for my problem with the same search I had done at the start only to find a very complete tutorial.

The second issue was in compiling the AVR toolchain due to some dependency hell I ran into with the boost library. Long story short. gnu-avr-toolchain is a package in the repo. Next time I will search the apt-cache like a sane user. After finishing this I had two choices, produce or copy a make file to build an uploadable hex or find an IDE that could do it for me. My experience with most IDEs thus far has been pretty terrible but I figured I would give Eclipse another shot due to the excellent AVR plug-in available along with vi key-bindings accessible through the vrapper plug-in.From there it was simply making a couple configuration changes and uploading the hex file automagically.

Although the above is fairly condensed as I have been working on this for the past couple days. I’ve stopped using the book on C I mentioned a while back primarily as I can try and code something more applicable to my situation and learn through doing.

Finally, I’ve been using my Boarduino as a programming board which has worked wonderfully, but unfortunately the pins don’t line up the m328p schematic so I’ve often misplaced a pin and had to test it a couple times. This is very useful especially in its explanation of ports. I’m unsure on why part of that code points to pin 6 as 0x20 is 00010000 which I thought would specify the 5th pin. Some more reading should solve the issue. The Vin pin on the Boarduino is regulated. AWESOME! that saves me from buying a 7805 for a while at least. The clock is off I need to fiddle with the fuse bits.
Covered in mosquito bites.

Written by esotericalgorithm

July 8, 2010 at 2:32 pm

Leave a comment