<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tinkerlog &#187; eclipse</title>
	<atom:link href="http://tinkerlog.com/category/eclipse/feed/" rel="self" type="application/rss+xml" />
	<link>http://tinkerlog.com</link>
	<description>Alex' blog</description>
	<lastBuildDate>Fri, 21 Oct 2011 06:16:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AVR Plugins for Eclipse</title>
		<link>http://tinkerlog.com/2007/08/01/avr-plugins-for-eclipse/</link>
		<comments>http://tinkerlog.com/2007/08/01/avr-plugins-for-eclipse/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 22:51:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://tinkerlog.com/2007/08/01/avr-plugins-for-eclipse/</guid>
		<description><![CDATA[If you followed my previous post on how to use the famous Eclipse IDE to program AVR microcontrollers, you may have noticed, that there are some shortcomings. Especially the creation of a new project is cumbersome, as you have to change the compiler settings from gcc to avr-gcc over and over again.
But there two small [...]]]></description>
			<content:encoded><![CDATA[<p>If you followed my previous <a href="http://tinkerlog.com/2007/06/03/programming-avr-with-eclipse-and-winavr/">post</a> on how to use the famous Eclipse IDE to program AVR microcontrollers, you may have noticed, that there are some shortcomings. Especially the creation of a new project is cumbersome, as you have to change the compiler settings from gcc to avr-gcc over and over again.</p>
<p>But there two small nifty plugins, called <em>AVR Plugins for Eclipse</em>, written by Matthew R. McDougal, to help us out.</p>
<p><span id="more-22"></span><br />
<strong>Features</strong></p>
<p>Plugin one mostly adds a new target to your IDE. This way it is much easier to  configure your WinAVR compiler.</p>
<p>The second plugin adds a download button to Eclipse that enables directly uploading of the compiled hex file to the controller without leaving your IDE. For this purpose avrdude is used.</p>
<p><strong>Installation</strong></p>
<p>Installation is easy as for all Eclipse plugins.</p>
<ul>
<li>Download the archive from <a href="http://sourceforge.net/projects/avr-eclipse/">SourceForge.</a></li>
<li>Extract the archive.</li>
<li>Copy both folders into the plugins directory of your Eclipse installation.</li>
<li>Copy the batch file avr-objsplit.bat into the bin directory of your WinAVR installation.</li>
</ul>
<p><strong>How does it look like</strong></p>
<p>If everything went well, you should see the new AVR download button in the Eclipse tool bar.  Selecting New-&gt;Project starts the project wizard. Now you can select the new AVR-Cross target.</p>
<p><img src="http://tinkerlog.com/wp-content/uploads/2007/08/avr-wizard1.PNG" alt="avr-wizard1.PNG" /></p>
<p>To configure the upload process you have to choose Window-&gt;Preferences-&gt;AVRDUDE to bring up the following dialog. Select your COM port, type of programmer etc.</p>
<p><a href="http://tinkerlog.com/wp-content/uploads/2007/08/avrdude-config.jpg" title="avrdude-config.jpg"><img src="http://tinkerlog.com/wp-content/uploads/2007/08/avrdude-config1.jpg" alt="avrdude-config1.jpg" /></a></p>
<p><strong>Conclusion</strong></p>
<p>It works great for me and makes the development with Eclipse for AVRs much more comfortable. I have mailed Matthew about making the download process more responsive, as for now you get just an hour glass. Hope he puts it in.</p>
<p><strong>Links</strong></p>
<ul>
<li><a href="http://sourceforge.net/projects/avr-eclipse/">AVR Plugins for Eclipse</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tinkerlog.com/2007/08/01/avr-plugins-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programming AVR with Eclipse and WinAVR</title>
		<link>http://tinkerlog.com/2007/06/03/programming-avr-with-eclipse-and-winavr/</link>
		<comments>http://tinkerlog.com/2007/06/03/programming-avr-with-eclipse-and-winavr/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 06:17:02 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[winavr]]></category>

		<guid isPermaLink="false">http://tinkerlog.com/2007/06/03/programming-avr-with-eclipse-and-winavr/</guid>
		<description><![CDATA[This is a log of what I have done to get Eclipse running with WinAVR on Windows XP. Maybe it&#8217;s helpfull for others.
Prerequisites

Download a Java Runtime JRE or JDK, if you do not have already. Anything greater 1.4.2 should be ok.
Download Eclipse 3.2.2 here 
 Download the CDT 3.1.2 plugin for Eclipse C/C++ development here
Download [...]]]></description>
			<content:encoded><![CDATA[<p>This is a log of what I have done to get Eclipse running with WinAVR on Windows XP. Maybe it&#8217;s helpfull for others.<br />
<strong>Prerequisites</strong></p>
<ul>
<li>Download a Java Runtime JRE or JDK, if you do not have already. Anything greater 1.4.2 should be ok.</li>
<li>Download Eclipse 3.2.2 <a href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-SDK-3.2.2-win32.zip" title="Eclipse 3.2.2">here </a></li>
<li> Download the CDT 3.1.2 plugin for Eclipse C/C++ development <a href="http://download.eclipse.org/tools/cdt/releases/callisto/dist/3.1.2" title="CDT Plugin">here</a></li>
<li>Download WinAVR  20070525 <a href="http://sourceforge.net/project/showfiles.php?group_id=68108" target="_blank" title="External link to http://sourceforge.net/project/showfiles.php?group_id=68108" class="externalLink"></a><a href="http://sourceforge.net/project/showfiles.php?group_id=68108" title="WinAVR">here</a></li>
</ul>
<p><span id="more-10"></span><br />
<strong>Install WinAVR</strong></p>
<p>Start the executable and choose a directory to install to. Mine goes to c:\winavr-20070525.</p>
<p><strong>Install Eclipse</strong></p>
<p>Extract the downloaded zip into a directory, e.g. c:\Programme\eclipse. Eclipse is now already working. You may want to create a desktop shortcut for the executable.</p>
<p><strong>Install CDT</strong></p>
<p>Extract the zip into a tmp directory. Then select the contents of the features and plugins folder and copy them to the respective folders beneath the eclipse folder.</p>
<p><strong>Startup</strong></p>
<ul>
<li>Open eclipse. It will ask for a workspace folder. If you are new to eclipse, choose a folder, where you would like to put your source code.</li>
<li>It starts with the Java perspective, but we want C/C++. Select &#8220;Open Perspective&#8221; from the upper right corner. Then select &#8220;Other&#8221;. Then select &#8220;C/C++&#8221;. Your screen should now show the perspective for C development.</li>
</ul>
<p><strong>Start a Project</strong></p>
<ul>
<li>Now select &#8220;File/New&#8221; of the menu. Then select &#8220;Managed make C project&#8221;. This creates a project with automated make. You do not have to take care of the makefile yourself.</li>
<li>Enter &#8220;test&#8221; as project name and select &#8220;next&#8221;.</li>
<li>Select &#8220;executable (gnu on windows)&#8221; as Project type. We will change this later.</li>
<li>&#8220;Debug&#8221; and &#8220;Release&#8221; are ok as targets. Release only is also ok.</li>
<li> Select &#8220;finish&#8221;.</li>
<li> Ignore the warning for now that appears in the problems tab.</li>
</ul>
<p><strong>Configuration</strong></p>
<p>Now we have to configure the settings for the WinAVR compiler and linker.</p>
<ul>
<li> Select &#8220;Project -&gt; properties&#8221;. If &#8220;properties&#8221; are greyed out, then click on the project folder &#8220;test&#8221; to select it. Now the &#8220;properties&#8221; menu should be selectable.</li>
<li> Select &#8220;C/C++ Build&#8221; on the left list.</li>
<li> Select &#8220;Release&#8221; as configuration. We will change this target only. If you want to configure the &#8220;Debug&#8221; target as well, then go through these steps again.</li>
<li>Select the &#8220;GCC C Compiler&#8221; in the tree below.</li>
<li> Change &#8220;gcc&#8221; to &#8220;avr-gcc&#8221;</li>
<li> Select &#8220;symbols&#8221; and enter a new symbol for the speed of your board,  e.g. &#8220;F_CPU=4096000&#8243;.</li>
<li> Select &#8220;Directories&#8221; and add &#8220;C:\WinAVR-20070525\avr\include&#8221; to the includes.</li>
<li> Select &#8220;Miscellaneous&#8221; and enter your type of controller, e.g. &#8220;-mmcu=atmega8&#8243;.</li>
<li> Select &#8220;GCC C Linker&#8221; and change &#8220;gcc&#8221; to &#8220;avr-gcc&#8221;.</li>
<li> Select the tab &#8220;Build Steps&#8221;.</li>
<li> To convert the executable into a hex file, we use a post build step. Enter &#8220;Post-build step&#8221; as<br />
<code>"avr-objcopy -j .text -j .data -O ihex test.exe test.hex".</code></li>
<li>Select &#8220;ok&#8221; to close the properties dialog.</li>
</ul>
<p><strong>Testing the Configuration</strong></p>
<ul>
<li>Right-click on your project folder and select &#8220;New -&gt; Source File&#8221;</li>
<li>Enter &#8220;test.c&#8221;. Now write a small test program.
<pre class="prettyprint">

/*
 * test.c
 */
#include &lt;util/delay.h&gt;
#include &lt;avr/io.h&gt;
#define LED PD4

int main(void) {
  // define pd4 as output
  DDRD |= (1 &lt;&lt; LED);

  while (1) {
    PORTD |= (1 &lt;&lt; LED);    // switch on
    _delay_ms(100);
    _delay_ms(100);
    PORTD &amp;= ~(1 &lt;&lt; LED);    // switch off
    _delay_ms(100);
    _delay_ms(100);
  }
return 0;
}</pre>
</li>
<li>Saving triggers an automated build run. The console output should look like this:
<pre class="prettyprint">
**** Build of configuration Release for project test ****
make -k all

Building file: ../test.c
Invoking: GCC C Compiler

avr-gcc -DF_CPU=4096000 -I"C:WinAVR-20070525avrinclude" -O3 -Wall -c
-fmessage-length=0 -mmcu=atmega8 -MMD -MP -MF"test.d" -MT"test.d" -o"test.o" "../test.c"
Finished building: ../test.c

Building target: test.exe

Invoking: GCC C Linker
avr-gcc  -o"test.exe"  ./test.o
Finished building target: test.exemake --no-print-directory post-build

avr-objcopy -j .text -j .data -O ihex test.exe test.hex

Build complete for project test</pre>
</li>
<li>Now open up a command line in your project folder. Create a batch file &#8220;flash.bat&#8221; to transfer the hex file to your controller. This depends on your controller, programmer, etc. Mine looks like this:<br />
<code>c:\winavr\bin\avrdude -v -F -p ATmega8 -c avr910 -P com4 -U flash:w:%1:i. </code>The -F switch is in the to force writing, even if the device signature is not recognized. Its just reversed. Omit it if you have no problems with that.</li>
<li>Now start the batch file to program your controller.
<pre class="prettyprint">
C:dataavrtest&gt;flash Releasetest.hex
C:dataavrtest&gt;c:winavrbinavrdude -v -F -p ATmega8 -c avr910 -P com4 -U flash:w:Releasetest.hex:i

avrdude: Version 5.1cvs

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "c:winavrbinavrdude.conf"

Using Port            : com4
         Using Programmer      : avr910
         AVR Part              : ATMEGA8
         Chip Erase delay      : 10000 us
         PAGEL                 : PD7
         BS2                   : PC2
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    10   128    0 no        512    0      0  9000  90
00 0xff 0xff
           flash         33     6    64    0 yes      8192   64    128  4500  45
00 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00
Programmer Type : avr910
         Description     : Atmel Low Cost Serial Programmer
Found programmer: Id = "AVR ISP"; type = S
    Software Version = 2.3; Hardware Version = 2.0
Programmer supports auto addr increment.
Programmer supports the following devices:
    Device code: 0x1c = (unknown)
    Device code: 0x55 = ATtiny12
    Device code: 0x01 = ATtiny13
    Device code: 0x56 = ATtiny15
    Device code: 0x13 = AT90S1200
    Device code: 0x28 = AT90S4414
    Device code: 0x20 = ATtiny84
    Device code: 0x4c = AT90S2343
    Device code: 0x30 = AT90S4433
    Device code: 0x6c = AT90S4434
    Device code: 0x38 = AT90S8515
    Device code: 0x68 = AT90S8535
    Device code: 0x41 = ATMEGA103
    Device code: 0x46 = (unknown)
    Device code: 0x44 = (unknown)
    Device code: 0x03 = (unknown)
    Device code: 0x75 = ATMEGA6490
    Device code: 0x74 = ATMEGA6450
    Device code: 0x63 = (unknown)
    Device code: 0x64 = ATMEGA163
    Device code: 0x79 = (unknown)
    Device code: 0x14 = (unknown)
    Device code: 0x15 = (unknown)
    Device code: 0x16 = (unknown)
    Device code: 0x17 = (unknown)
    Device code: 0x72 = ATMEGA32
    Device code: 0x60 = ATMEGA161
    Device code: 0x76 = ATMEGA8
    Device code: 0x77 = (unknown)
    Device code: 0x3b = (unknown)
    Device code: 0x6a = (unknown)
    Device code: 0x5e = ATTINY26
    Device code: 0x29 = (unknown)
    Device code: 0x2a = (unknown)
    Device code: 0x2b = (unknown)
    Device code: 0x06 = (unknown)
    Device code: 0x07 = (unknown)
    Device code: 0x08 = (unknown)
    Device code: 0x21 = (unknown)
    Device code: 0x09 = (unknown)
    Device code: 0x0a = (unknown)
    Device code: 0x22 = (unknown)
    Device code: 0x23 = (unknown)
    Device code: 0x24 = (unknown)
    Device code: 0x0b = (unknown)
    Device code: 0x0c = (unknown)
    Device code: 0x0d = (unknown)
    Device code: 0x18 = (unknown)
    Device code: 0x19 = (unknown)
    Device code: 0x25 = (unknown)
    Device code: 0x26 = (unknown)
    Device code: 0x27 = (unknown)
    Device code: 0x1a = (unknown)
    Device code: 0x1b = (unknown)
    Device code: 0x4b = (unknown)
    Device code: 0x4d = (unknown)
    Device code: 0x4e = (unknown)
    Device code: 0x4f = (unknown)

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x07931e

avrdude: Expected signature for ATMEGA8 is 1E 93 07

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D9

avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.

avrdude: erasing chip

avrdude: reading input file "Releasetest.hex"
avrdude: writing flash (122 bytes):
Writing | ################################################## | 100% 0.53s

avrdude: 122 bytes of flash written

avrdude: verifying flash memory against Releasetest.hex:
avrdude: load data flash data from input file Releasetest.hex:
avrdude: input file Releasetest.hex contains 122 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.25s

avrdude: verifying ...
avrdude: 122 bytes of flash verified
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D9
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

C:dataavrtest&gt;</pre>
</li>
<li>If all went well and you see an LED flashing, congratulations, you did it.</li>
</ul>
<p><strong>Notes</strong></p>
<p>If you look closely at the steps where I program the controller, you will notice, that I do not use the avr-dude  that came with the last WinAVR release. I tried it, but it refused to work, always complaining about not beeing able to verify the fuses. I went on with my old avr-dude which worked perfect.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinkerlog.com/2007/06/03/programming-avr-with-eclipse-and-winavr/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

