Figure 6. Install complete.
Figure 7. Start a project.
Figure 8. Configure microcontroller settings.
22 SERVO 08.2008
In Figure 8, you see that I’ve selected the processor
type and the clock speed. Study your product document for
your chosen AVR microcontroller carefully to select its clock
speed and other settings we’ll discuss later. I selected the
AVR Target Hardware to set these features. If you look at
the Environment selection (after you click on the triangle to
open the C/C++ Build category), you’ll see that the IDE has
already found your AVR MacPack directory and has set
everything up for us! Totally cool! We’re ready to make a
program and project.
When we created our project, a folder was created
called Documents/Workspace/Tiny26. Here, you can drop
or create your C files for your projects. If you copy files
there, go to the Eclipse IDE in the Explorer Window and
right-click on the project — in this case, Tiny26 — select
Refresh, and the project will pick up the files. If you are
making new files, then just remember to save them there.
When you have everything ready to go, it is time to build
your project. At this time, the Debug configuration isn’t
all that useful since it doesn’t create a hex file. So, make
sure you are using your Release configuration. To do this,
navigate Project -> Build Configuration -> Set Active ->
Release.
To build, you can navigate Project -> Build All, use the
<propeller> B hot key, or press the Build All icon on the
toolbar (looks like a page with 1s and 0s on it.) If there are
any problems in the build, the errors will show up in the
Console window at the bottom of the IDE window. To go
to the error line in your source code, click on the Problems
window and double-click on the error; the IDE will take you
to the line. See Figure 9 for a condensed view of the IDE
and those tabs.
You’ll note a tab called AVR Device Explorer; this is
a very nice utility that shows you all of the hardware
registers, I/O ports, and interrupt sources and their names
for your chosen microcontroller.
Programming a Microcontroller
I’ve reached the end of my allotted space now. In my
next installment, I will show you how to configure a
programmer board — an AVRISP 2 to be specific — to
program your microcontroller, and how to add a tool to
your Eclipse IDE to program at a press of a button. SV
Figure 9. The Eclipse IDE window.