<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bill&#039;s Electronics &#38; Software Development Notes &#187; Uncategorized</title>
	<atom:link href="http://wburris.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://wburris.com</link>
	<description></description>
	<lastBuildDate>Tue, 22 Jun 2010 22:11:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='wburris.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/3ac0e0ae9abe85664e3f557411c38571?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bill&#039;s Electronics &#38; Software Development Notes &#187; Uncategorized</title>
		<link>http://wburris.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://wburris.com/osd.xml" title="Bill&#039;s Electronics &#38; Software Development Notes" />
	<atom:link rel='hub' href='http://wburris.com/?pushpress=hub'/>
		<item>
		<title>Xilinx MicroBlaze Embedded Processor On Opal Kelly Board</title>
		<link>http://wburris.com/2010/06/22/xilinx-microblaze-embedded-processor-on-opal-kelly-board/</link>
		<comments>http://wburris.com/2010/06/22/xilinx-microblaze-embedded-processor-on-opal-kelly-board/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 22:05:55 +0000</pubDate>
		<dc:creator>wburris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fpga]]></category>
		<category><![CDATA[Xilinx]]></category>
		<category><![CDATA[ISE]]></category>
		<category><![CDATA[XPS]]></category>
		<category><![CDATA[MicroBlaze]]></category>
		<category><![CDATA[Spartan 3]]></category>
		<category><![CDATA[Embedded Processor]]></category>
		<category><![CDATA[EDK]]></category>
		<category><![CDATA[XEM3001]]></category>

		<guid isPermaLink="false">http://wburris.com/?p=56</guid>
		<description><![CDATA[Opal Kelly has support information for using MicroBlaze with their boards on their website but I was unable to get it to work. Their example uses EDK version 8.2 and the XEM3010-1500 boards. I am using EDK 12.1 and the XEM3001 board. Here are my notes for how I was able to run the MicroBlaze [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=56&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Opal Kelly has support information for using MicroBlaze with their boards on their <a href="http://wiki.opalkelly.com/microblaze">website</a> but I was unable to get it to work.  Their example uses EDK version 8.2 and the XEM3010-1500 boards.  I am using EDK 12.1 and the XEM3001 board.</p>
<p>Here are my notes for how I was able to run the MicroBlaze on the XEM3001 board and integrate it with my top level verilog code.</p>
<p>Create a New Project in Xilinx ISE (12.1).  I am using the Opal Kelly <a href="http://www.opalkelly.com/products/xem3001/">XEM3001</a> board, so the project settings are, Family = Spartan3, Device = XC3S400, Package = PQ208, Speed = -4, and my Preferred Language is Verilog.</p>
<p>Add a top level HDL module and .ucf files from a previous project or the <a href="http://wiki.opalkelly.com/tutorial">First</a> example from Opal Kelly, as well as the okLibrary.v file.</p>
<p>Copy the Opal Kelly .ngc files to your project directory.</p>
<p>Add a New Source and select Embedded Processor.  This will launch Xilinx Platform Studio.</p>
<p>In Base System Builder:<br />
- create a new design<br />
- I would like to create a system for a custom board<br />
- Single-Processor System<br />
- Reference Clock Frequency = 50 MHz, Processor Type = MicroBlaze, System Clock Frequency = 66.67 MHz, Local Memory = 16 KB<br />
- don&#8217;t make any changes on Peripheral Configuration for now<br />
- keep clicking next to finish the Base System Builder</p>
<p>From IP Catalog add two General Purpose IO Peripherals to be used for connecting to LEDS and Buttons on the Opal Kelly board. Change the names for xps_gpio_0 &amp; xps_gpio_1 to leds &amp; buttons. Connect them to mb_plb. On the ports tab, make external connections for the leds &amp; buttons. On the Addresses tab click Generate Addresses.</p>
<p>In the Hardware menu, Generate Netlist</p>
<p>In the Software Menu, Add Software Application Project.<br />
Add a new .c file to the Sources section of the project and write the code for your application.<br />
Right click on the Project and select, Mark to Initialize BRAMs<br />
In compiler options select no optimization (because my example uses a software delay)<br />
Right click on the Project and select, Build Project</p>
<p>In ISE<br />
- highlight the .xmp module in the Design Window<br />
- double click View HDL Instantiation Template in the Processes window<br />
- copy the Instantiation Template to your top level module and wire it up<br />
- with the top module highlighted in the Design Window, double click Update Bitstream with Processor Data in the Processes window<br />
- use Opal Kelly FrontPanel to download the download.bit file to the board and test it</p>
<p><strong>The Verilog code:</strong></p>
<p><code><br />
`default_nettype none<br />
`timescale 1ns / 1ps</code></p>
<p>module okTop(<br />
input  wire clk1,<br />
input  wire [7:0]  hi_in,<br />
output wire [1:0]  hi_out,<br />
inout  wire [15:0] hi_inout,</p>
<p>output wire [7:0] led,<br />
input wire [3:0] button<br />
);</p>
<p>parameter DATA_WIDTH = 16;</p>
<p>wire [DATA_WIDTH-1:0] Version = 1;</p>
<p>// Opal Kelly Module Interface Connections<br />
wire ti_clk;<br />
wire [30:0] ok1;<br />
wire [16:0] ok2;</p>
<p>wire [15:0] command_pulse;   //command pulses from USB<br />
wire reset_n = !command_pulse[0];<br />
//wire reset = command_pulse[0];<br />
wire reset = button[0];<br />
wire run = command_pulse[1];<br />
wire stop = command_pulse[2];</p>
<p>reg running;</p>
<p>// Instantiate the module<br />
(* BOX_TYPE = &#8220;user_black_box&#8221; *)<br />
mbTest instance_name (<br />
.fpga_0_clk_1_sys_clk_pin(clk1),<br />
.fpga_0_rst_1_sys_rst_pin(reset),<br />
.buttons_GPIO_IO_I_pin(button),<br />
.leds_GPIO_IO_O_pin(led)<br />
);</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
// Instantiate the okHostInterface and connect endpoints to<br />
// the Opal Kelly Module Interface<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
okHost hostIF(.hi_in(hi_in), .hi_out(hi_out), .hi_inout(hi_inout),<br />
.ti_clk(ti_clk), .ok1(ok1), .ok2(ok2));</p>
<p>okTriggerIn trigIn53 (.ok1(ok1), .ep_addr(8&#8242;h53),<br />
.ep_clk(ti_clk), .ep_trigger(command_pulse));</p>
<p>okWireOut ep3f (.ok1(ok1), .ok2(ok2), .ep_addr(8&#8242;h3f), .ep_datain(Version));</p>
<p>endmodule</p>
<p><strong>The C code:</strong></p>
<pre class="brush: cpp;">
#include &quot;xparameters.h&quot;
#include &quot;xgpio.h&quot;

int main( void )
{
	XGpio led, push;
	int i, psb_check;

	XGpio_Initialize( &amp;led, XPAR_LEDS_DEVICE_ID );
	XGpio_SetDataDirection( &amp;led, 1, 0x00000000);

	XGpio_Initialize( &amp;push, XPAR_BUTTONS_DEVICE_ID );
	XGpio_SetDataDirection( &amp;push, 1, 0xffffffff);

	int tmp;
	int j;
	while( 1 )
	{
		tmp = 1;
		for( j = 1 ; j &lt; 8 ; j++ )
		{
			XGpio_DiscreteWrite( &amp;led, 1, ~tmp );
			tmp *= 2;

			for( i=0 ; i &lt; 999999 ; i++ );
		}
	}
}
</pre>
<p>Click on the screenshots to go to flickr, then click the all sizes button at the top of the image to get to the high resolution version.</p>
<p><a href="http://www.flickr.com/photos/billburris/4725164459/" title="ise by wburris, on Flickr"><img src="http://farm2.static.flickr.com/1320/4725164459_bcbe6736d3.jpg" width="500" height="448" alt="ise" /></a></p>
<p><a href="http://www.flickr.com/photos/billburris/4725813612/" title="xps_av by wburris, on Flickr"><img src="http://farm2.static.flickr.com/1365/4725813612_86687c288b.jpg" width="500" height="355" alt="xps_av" /></a></p>
<p><a href="http://www.flickr.com/photos/billburris/4725813658/" title="xps_ports by wburris, on Flickr"><img src="http://farm2.static.flickr.com/1248/4725813658_0ea72421b3.jpg" width="500" height="355" alt="xps_ports" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wburris.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wburris.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wburris.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wburris.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wburris.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wburris.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wburris.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wburris.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=56&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wburris.com/2010/06/22/xilinx-microblaze-embedded-processor-on-opal-kelly-board/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f221e18973c1b2223afa244cd991fc6e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wburris</media:title>
		</media:content>

		<media:content url="http://farm2.static.flickr.com/1320/4725164459_bcbe6736d3.jpg" medium="image">
			<media:title type="html">ise</media:title>
		</media:content>

		<media:content url="http://farm2.static.flickr.com/1365/4725813612_86687c288b.jpg" medium="image">
			<media:title type="html">xps_av</media:title>
		</media:content>

		<media:content url="http://farm2.static.flickr.com/1248/4725813658_0ea72421b3.jpg" medium="image">
			<media:title type="html">xps_ports</media:title>
		</media:content>
	</item>
		<item>
		<title>sourceforge</title>
		<link>http://wburris.com/2010/02/03/sourceforge/</link>
		<comments>http://wburris.com/2010/02/03/sourceforge/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 03:33:57 +0000</pubDate>
		<dc:creator>wburris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[doodle space]]></category>
		<category><![CDATA[doodlespace]]></category>
		<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[sourceforge]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tortoisesvn]]></category>

		<guid isPermaLink="false">http://wburris.com/?p=49</guid>
		<description><![CDATA[I have created a sourceforge project called Doodle Space which I will use to upload complete source code for this blog. Doodle Space is at http://sourceforge.net/projects/doodlespace/. Use your SVN client to find the source code at https://doodlespace.svn.sourceforge.net/svnroot/doodlespace. I use TortoisesSVN, which can be found at http://tortoisesvn.tigris.org/. So far it only contains the CsLibDemo folder, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=49&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have created a sourceforge project called Doodle Space which I will use to upload complete source code for this blog.  Doodle Space is at <a href="http://sourceforge.net/projects/doodlespace/">http://sourceforge.net/projects/doodlespace/</a>.</p>
<p>Use your SVN client to find the source code at https://doodlespace.svn.sourceforge.net/svnroot/doodlespace.</p>
<p>I use TortoisesSVN, which can be found at <a href="http://tortoisesvn.tigris.org/">http://tortoisesvn.tigris.org/</a>.</p>
<p>So far it only contains the CsLibDemo folder, which is the code for the <a href="http://wburris.com/2009/11/29/c-class-libraries/">C# Class Libraries</a>, and <a href="http://wburris.com/2009/11/30/using-net-in-labview/">Using .NET in LabVIEW</a> blog entries.  Download the contents of the trunk directory.</p>
<p>Now all I have to do is find some time to upload examples from my old website and write some new ones.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wburris.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wburris.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wburris.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wburris.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wburris.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wburris.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wburris.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wburris.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=49&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wburris.com/2010/02/03/sourceforge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f221e18973c1b2223afa244cd991fc6e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wburris</media:title>
		</media:content>
	</item>
		<item>
		<title>Using .NET in LabVIEW</title>
		<link>http://wburris.com/2009/11/30/using-net-in-labview/</link>
		<comments>http://wburris.com/2009/11/30/using-net-in-labview/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 01:53:25 +0000</pubDate>
		<dc:creator>wburris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET dotnet dll LabVIEW]]></category>

		<guid isPermaLink="false">http://wburris.com/?p=44</guid>
		<description><![CDATA[If you have .NET class libraries from previous work, but now need to work in LabVIEW, you can easily use those libraries in your LabVIEW applications. In the LabVIEW functions window look for .NET under Connectivity. Place the Constructor VI on your block diagram. A window will pop up to let you browse to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=44&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have .NET class libraries from previous work, but now need to work in LabVIEW, you can easily use those libraries in your LabVIEW applications.</p>
<p>In the LabVIEW functions window look for .NET under Connectivity.</p>
<p><a href="http://www.flickr.com/photos/billburris/4145826276/" title="LvFunctions by wburris, on Flickr"><img src="http://farm3.static.flickr.com/2728/4145826276_d2ecc12efe_o.jpg" width="327" height="532" alt="LvFunctions" /></a></p>
<p>Place the Constructor VI on your block diagram. A window will pop up to let you browse to the .NET dll you want to use.  After selecting the dll, you then select which class from the dll that you want to use. Use the Property Node and Invoke Node VIs to utilize the .NET object.</p>
<p>The following image shows a LabView block diagram for using the Calc.dll which was created in previous blog post.</p>
<p><a href="http://www.flickr.com/photos/billburris/4145065999/" title="LvBlockDiagram by wburris, on Flickr"><img src="http://farm3.static.flickr.com/2602/4145065999_b12564d7c1.jpg" width="500" height="201" alt="LvBlockDiagram" /></a></p>
<p>The following image shows the LabVIEW front panel for the application.</p>
<p><a href="http://www.flickr.com/photos/billburris/4145825878/" title="LvFrontPanel by wburris, on Flickr"><img src="http://farm3.static.flickr.com/2561/4145825878_598b247f48_o.jpg" width="397" height="446" alt="LvFrontPanel" /></a></p>
<p>The front panel here shows the error in control and error out indicator.  If this is your top level VI, you may want to hide these by right clicking on them, selecting Advanced then Hide Control or Hide Indicator.  A properly written application would also have some error checking and handling built in.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wburris.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wburris.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wburris.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wburris.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wburris.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wburris.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wburris.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wburris.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=44&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wburris.com/2009/11/30/using-net-in-labview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f221e18973c1b2223afa244cd991fc6e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wburris</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2728/4145826276_d2ecc12efe_o.jpg" medium="image">
			<media:title type="html">LvFunctions</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2602/4145065999_b12564d7c1.jpg" medium="image">
			<media:title type="html">LvBlockDiagram</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2561/4145825878_598b247f48_o.jpg" medium="image">
			<media:title type="html">LvFrontPanel</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Class Libraries</title>
		<link>http://wburris.com/2009/11/29/c-class-libraries/</link>
		<comments>http://wburris.com/2009/11/29/c-class-libraries/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 03:33:51 +0000</pubDate>
		<dc:creator>wburris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[class libraries]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[NUnit]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://wburris.com/?p=25</guid>
		<description><![CDATA[When writing programs for .NET it works best to put all code into class libraries. This makes it easier to reuse the code in other .NET projects as well as in other environments. Here I will do a simple four function calculator to show how to set up multiple class library projects in a single [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=25&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When writing programs for .NET it works best to put all code into class libraries. This makes it easier to reuse the code in other .NET projects as well as in other environments.</p>
<p>Here I will do a simple four function calculator to show how to set up multiple class library projects in a single solution in Visual Studio.</p>
<p>The following image shows the projects in the Solution Explorer window.</p>
<p><a title="SolutionExplorer by wburris, on Flickr" href="http://www.flickr.com/photos/billburris/4141892601/"><img src="http://farm3.static.flickr.com/2516/4141892601_22725c3c18_o.jpg" alt="SolutionExplorer" width="284" height="360" /></a></p>
<p>The CsLibDemo is a Windows Application project. The other projects are Class Library projects.  When the wizard created the CsLibDemo project it created the Program.cs file and a Windows Form file.  I moved the Windows Form file to the CsLibDemoUI project. Any user interface Forms and Control Librairs that are specific to this application can be put into this project.  Any user interface classes that are to be used in other applications should be placed in a separate project.</p>
<p>The following image is a screen shot of Windows Explorer, showing how the projects are organized on the hard drive.</p>
<p><a title="WindowsExplorer by wburris, on Flickr" href="http://www.flickr.com/photos/billburris/4142649402/"><img src="http://farm3.static.flickr.com/2782/4142649402_de31a61387.jpg" alt="WindowsExplorer" width="500" height="175" /></a></p>
<p>The following image is the user interface for testing the class library.</p>
<p><a title="Calc by wburris, on Flickr" href="http://www.flickr.com/photos/billburris/4141892831/"><img src="http://farm3.static.flickr.com/2703/4141892831_22c0552d0d_o.jpg" alt="Calc" width="434" height="196" /></a></p>
<p>Unit testing is useful for ensuring the proper functioning of your class library. Download NUnit from <a href="http://www.nunit.org/index.php">nunit.org</a>. Here is a screen shot of the NUnit program.</p>
<p><a title="NUnit by wburris, on Flickr" href="http://www.flickr.com/photos/billburris/4141892505/"><img src="http://farm3.static.flickr.com/2602/4141892505_2e7a8810df.jpg" alt="NUnit" width="500" height="351" /></a></p>
<p>Here is the code in the Calc.cs file.</p>
<pre class="brush: csharp;">
namespace MyCalc
{
    public class Calc
    {
        public double Add(double a, double b)
        {
            return a + b;
        }

        public double Subtract(double a, double b)
        {
            return a - b;
        }

        public double Multiply(double a, double b)
        {
            return a * b;
        }

        public double Divide(double a, double b)
        {
            return a / b;
        }
    }
}
</pre>
<p>Here is the code from CsLibDemoForm.cs</p>
<pre class="brush: csharp;">
namespace CsLibDemoUI
{
    public partial class CsLibDemoForm : Form
    {
        Calc calc = new Calc();

        public CsLibDemoForm()
        {
            InitializeComponent();
        }

        private void buttonAdd_Click(object sender, EventArgs e)
        {
            textBoxC.Text = calc.Add(double.Parse(textBoxA.Text), double.Parse(textBoxB.Text)).ToString();
        }

        private void buttonSubtract_Click(object sender, EventArgs e)
        {
            textBoxC.Text = calc.Subtract(double.Parse(textBoxA.Text), double.Parse(textBoxB.Text)).ToString();
        }

        private void buttonMultiply_Click(object sender, EventArgs e)
        {
            textBoxC.Text = calc.Multiply(double.Parse(textBoxA.Text), double.Parse(textBoxB.Text)).ToString();
        }

        private void buttonDivide_Click(object sender, EventArgs e)
        {
            textBoxC.Text = calc.Divide(double.Parse(textBoxA.Text), double.Parse(textBoxB.Text)).ToString();
        }
    }
}
</pre>
<p>Here is the unit test code from CalcTest.cs</p>
<pre class="brush: csharp;">
namespace CsLibDemo.Tests
{
	using System;
	using NUnit.Framework;
    using MyCalc;

	[TestFixture]
	public class CalcTest
	{
		protected double dValue1;
		protected double dValue2;
        protected Calc calc;

		[SetUp] public void Init()
		{
			dValue1= 6;
			dValue2= 3;
            calc = new Calc();
		}

		[Test] public void Add()
		{
            double result = calc.Add(dValue1, dValue2);
			Assert.AreEqual(9, result, &quot;Add&quot;);
		}

        [Test]
        public void Subtract()
        {
            double result = calc.Subtract(dValue1, dValue2);
            Assert.AreEqual(3, result, &quot;Subtract&quot;);
        }

        [Test]
        public void Multiply()
        {
            double result = calc.Multiply(dValue1, dValue2);
            Assert.AreEqual(18, result, &quot;Multiply&quot;);
        }

		[Test] public void Divide()
		{
            double result = calc.Divide(dValue1, dValue2);
            Assert.AreEqual(2, result, &quot;Multiply&quot;);
        }
	}
}
</pre>
<p>The unit test code here needs some improvement, but I was keeping it simple for demonstration purposes.</p>
<p>In a future blog I will talk about reusing this class library in LabVIEW.</p>
<p>If anyone has ideas about how to format code in wordpress, or wants more details please leave comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wburris.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wburris.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wburris.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wburris.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wburris.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wburris.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wburris.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wburris.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=25&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wburris.com/2009/11/29/c-class-libraries/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f221e18973c1b2223afa244cd991fc6e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wburris</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2516/4141892601_22725c3c18_o.jpg" medium="image">
			<media:title type="html">SolutionExplorer</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2782/4142649402_de31a61387.jpg" medium="image">
			<media:title type="html">WindowsExplorer</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2703/4141892831_22c0552d0d_o.jpg" medium="image">
			<media:title type="html">Calc</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2602/4141892505_2e7a8810df.jpg" medium="image">
			<media:title type="html">NUnit</media:title>
		</media:content>
	</item>
		<item>
		<title>Avnet Spartan 3E Evaluation Kit</title>
		<link>http://wburris.com/2009/04/13/avnet-spartan-3e-evaluation-kit/</link>
		<comments>http://wburris.com/2009/04/13/avnet-spartan-3e-evaluation-kit/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 04:27:21 +0000</pubDate>
		<dc:creator>wburris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[fpga]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[Spartan 3E]]></category>
		<category><![CDATA[Xilinx]]></category>
		<category><![CDATA[QuickUSB]]></category>
		<category><![CDATA[Mitutoyo]]></category>

		<guid isPermaLink="false">http://wburris.wordpress.com/?p=7</guid>
		<description><![CDATA[This was a project from 2006. I will have more to say about programming Xilinx FPGAs and using USB in the future, just not with the Avnet Spartan 3E Evaluation Kit. The end user is still using this, and this particular board dosen&#8217;t seem to be on the market anymore. Currently I am working with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=7&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This was a project from 2006.  I will have more to say about programming Xilinx FPGAs and using USB in the future, just not with the Avnet Spartan 3E Evaluation Kit.  The end user is still using this, and this particular board dosen&#8217;t seem to be on the market anymore.  Currently I am working with Opal Kelly and QuickUSB modules, for connecting custom electronics into the computer via USB.</p>
<p>Dec 13, 2006 &#8211; updated Jan 4, 2007</p>
<p>About 15 years ago I made a readout for a Mitutoyo caliper, by connecting it  to an 8255 parallel I/O port on an 8085 board that I had designed and wire wrapped. The  data returning from the caliper, was decoded by software running  on the 8085. This software monitored the port looking for clock pulse  edges. On the clock edge the state of the data line was recorded. By  reading all the bits in this manner the position reading was constructed.  A C program running on a PC read the position measurement from the 8085 board.  The 8085 also performed other functions, like reading an ADC and running stepper  motors.</p>
<p>About 10 years ago I did another interface using TTL logic chips, wire  wrapped on an ISA card plugged into a 286 running MSDOS. A C++ program was  written to read the position from this board as well as data from other  instruments. That system is still being used, but now they want to use a modern  computer running Windows XP, and not have to rely on the 286 running MSDOS.</p>
<p>The readout system is now being built to connect via USB. I chose to use the  Avnet Spartan 3E Evaluation Kit.</p>
<p><a href="http://www.flickr.com/photos/billburris/3436166011/" title="IMG_1340 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3558/3436166011_1bdc7214a6_m.jpg" width="240" height="180" alt="IMG_1340" /></a></p>
<p>The PROM for the <a href="http://www.cypress.com/">Cypress</a> USB Micro controller was replaced by  <a href="http://www.quickusb.com/">QuickUSB</a> firmware purchased from Bitwise Systems.</p>
<p><a href="http://www.flickr.com/photos/billburris/3436197765/" title="IMG_1342 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3647/3436197765_0e77f3e846_m.jpg" width="240" height="180" alt="IMG_1342" /></a></p>
<p>With QuickUSB running the Avnet utility for configuring the FPGA will no  longer function, so I borrowed an old <a href="http://www.xilinx.com/">Xilinx</a> cable (can&#8217;t remember the name),  but iMPACT 8.2 did not support this cable. By replacing the 0 ohm resistor  on JT2 with a jumper I could switch between starting the Cypress chip with  QuickUSB firmware or no firmware. By using a jumper on the board you can  also reset the Cypress chip without unplugging the USB cable. This way you  can be running in no firmware mode, to configure the FPGA using the Avnet  utility. The jumper was changed and the cypress reset to start up with  QuickUSB. I could then test my Windows code which reads the Mitutoyo  position reading from my FPGA logic.</p>
<p><a href="http://www.flickr.com/photos/billburris/3436224769/" title="IMG_1970 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3632/3436224769_7dd452c9d1_m.jpg" width="240" height="180" alt="IMG_1970" /></a></p>
<p><a href="http://www.flickr.com/photos/billburris/3436252437/" title="IMG_1971 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3356/3436252437_bf76de93b7_m.jpg" width="240" height="180" alt="IMG_1971" /></a></p>
<p>The vector board visible beneath the Avnet board just holds the jumper for  selecting the Cypress chip firmware. An extra connector was added to the  cable for clipping the scope probes on. It would have been easier if I  could get ModelSim to work with ISE 8.2, to get my logic worked out before  dumping it into the FPGA.</p>
<p><a href="http://www.flickr.com/photos/billburris/3436289383/" title="IMG_2439 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3557/3436289383_03e8bd192d_m.jpg" width="240" height="180" alt="IMG_2439" /></a></p>
<p>The Xilinx Platform USB cable was obtained to make it easier to change the  FPGA configuration. Downloading via the Platform USB cable fails when  first starting the board with QuickUSB firmware. After the FPGA has been  configured once with the board in Cypress with no firmware mode, it can then be  reconfigured when the Cypress chip is running QuickUSB.</p>
<p><a href="http://www.flickr.com/photos/billburris/3436315351/" title="IMG_2440 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3557/3436315351_d5b1da4e11_m.jpg" width="240" height="180" alt="IMG_2440" /></a></p>
<p>The Mitutoyo signals were fed back out on other FPGA pins for looking at with  the scope. Bad scope grounding gives wavy traces.</p>
<p><a href="http://www.flickr.com/photos/billburris/3437149664/" title="IMG_2443 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3383/3437149664_e555c3e92d_m.jpg" width="240" height="180" alt="IMG_2443" /></a></p>
<p>Since it works, I cleaned up my cables.</p>
<p><a href="http://www.flickr.com/photos/billburris/3437178376/" title="IMG_2707 by wburris, on Flickr"><img src="http://farm4.static.flickr.com/3615/3437178376_709c9fefc6_m.jpg" width="240" height="180" alt="IMG_2707" /></a></p>
<p>Getting my FPGA configuration into the SPI Flash memory on this board was a  real nightmare. I am using ISE 8.2, but you need ISE 7.1 in order to  generate a HEX file to use with the Avnet utility for Writing to the SPI Flash.  What I didn&#8217;t realize, and what Avnet did not mention in their documentation was  the need to do a bulk erase before doing a write.</p>
<p>You should be able to use iMPACT with the Platform Cable USB and flying leads  connected to the SPI Flash connector on the Avnet board. Bugs in iMPACT  8.2 prevented this from working. There is also a utility xspi_usb which  can be downloaded from the Xilinx website with should do the job, but it has the  same bugs as iMPACT 8.2. Search for xapp445 in the documentation section  of the <a href="http://www.xilinx.com/">Xilinx</a> website.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wburris.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wburris.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wburris.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wburris.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wburris.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wburris.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wburris.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wburris.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=7&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wburris.com/2009/04/13/avnet-spartan-3e-evaluation-kit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f221e18973c1b2223afa244cd991fc6e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wburris</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3558/3436166011_1bdc7214a6_m.jpg" medium="image">
			<media:title type="html">IMG_1340</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3647/3436197765_0e77f3e846_m.jpg" medium="image">
			<media:title type="html">IMG_1342</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3632/3436224769_7dd452c9d1_m.jpg" medium="image">
			<media:title type="html">IMG_1970</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3356/3436252437_bf76de93b7_m.jpg" medium="image">
			<media:title type="html">IMG_1971</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3557/3436289383_03e8bd192d_m.jpg" medium="image">
			<media:title type="html">IMG_2439</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3557/3436315351_d5b1da4e11_m.jpg" medium="image">
			<media:title type="html">IMG_2440</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3383/3437149664_e555c3e92d_m.jpg" medium="image">
			<media:title type="html">IMG_2443</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3615/3437178376_709c9fefc6_m.jpg" medium="image">
			<media:title type="html">IMG_2707</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction</title>
		<link>http://wburris.com/2009/04/13/introduction/</link>
		<comments>http://wburris.com/2009/04/13/introduction/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 01:36:33 +0000</pubDate>
		<dc:creator>wburris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wburris.wordpress.com/?p=3</guid>
		<description><![CDATA[I started a website in about 1995, but was never sure what to do with it. At first I called it SpiderBytes Consulting, and was trying to see if I could get some software development contracts. When I eventually got around to seeing about a domain name I discovered that there was someone else was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=3&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I started a website in about 1995, but was never sure what to do with it.  At first I called it SpiderBytes Consulting, and was trying to see if I could get some software development contracts.  When I eventually got around to seeing about a domain name I discovered that there was someone else was using the name SpiderBytes.</p>
<p>After I started playing around with COM (Component Object Model), ActiveX and ATL (Active Template Library), I changed the name of my website to ATL Components Notebook.  Eventually I shortened that to Components Notebook and registered the domain name <a href="http://www.componentsnotebook.com/default.aspx">componentsnotebook.com</a>.</p>
<p>Since the introduction of .NET in 2001, I have been using C# as my main programming language, and started posting tutorials and sample code on my website.  Jumping on the C# bandwagon so early in the game, landed me a few technical review jobs for Osborne/McGraw Hill &amp; Wrox.  To make a long story short, I never got around to generating much content for my site, and haven&#8217;t posted any tutorials or code samples since 2006.</p>
<p>I have now shut down that site. This blog will be where I post hardware and software articles. Non-technical bog posts will be on my other blog at <a href="http://billburris.blogspot.com/">http://billburris.blogspot.com/</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wburris.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wburris.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wburris.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wburris.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wburris.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wburris.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wburris.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wburris.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wburris.com&amp;blog=7187567&amp;post=3&amp;subd=wburris&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wburris.com/2009/04/13/introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f221e18973c1b2223afa244cd991fc6e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wburris</media:title>
		</media:content>
	</item>
	</channel>
</rss>