<?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>Silly Science &#187; xmos</title>
	<atom:link href="http://www.silly-science.co.uk/tag/xmos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.silly-science.co.uk</link>
	<description>Electronics, Programming and Hacking About</description>
	<lastBuildDate>Sat, 17 Jul 2010 14:14:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Open Workbench Logic Sniffer First Impressions</title>
		<link>http://www.silly-science.co.uk/2010/05/15/open-workbench-logic-sniffer-first-impressions/</link>
		<comments>http://www.silly-science.co.uk/2010/05/15/open-workbench-logic-sniffer-first-impressions/#comments</comments>
		<pubDate>Sat, 15 May 2010 21:56:06 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Other Peoples Projects]]></category>
		<category><![CDATA[fpga]]></category>
		<category><![CDATA[open source hardware]]></category>
		<category><![CDATA[open workbench logic sniffer]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[spartan]]></category>
		<category><![CDATA[xc-3]]></category>
		<category><![CDATA[xilinx]]></category>
		<category><![CDATA[xmos]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=92</guid>
		<description><![CDATA[A while ago I spotted the Open Workbench Logic Sniffer on Hackaday. A logic sniffer . analyser is a useful tool have around the place and at ~$50 with some flying leads to make it up to the free shipping threshold. Seeing as it arrived the other day I thought I would share my first [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/05/sniffer_LRG.jpg"><img class="alignleft size-medium wp-image-93" title="Open Workbench Logic Sniffer" src="http://www.silly-science.co.uk/wp-content/uploads/2010/05/sniffer_LRG-300x225.jpg" alt="Open Workbench Logic Sniffer Board Photo" width="300" height="225" /></a> A while ago I spotted the Open Workbench Logic Sniffer on Hackaday. A logic sniffer . analyser is a useful tool have around the place and at ~$50 with some flying leads to make it up to the free shipping threshold. Seeing as it arrived the other day I thought I would share my first impressions of it&#8230;</p>
<p><span id="more-92"></span></p>
<p><strong>The Board</strong></p>
<p>The system comes shipped as a bare board &#8211; so I need to get some self adhesive rubber feet for it really &#8211; I will also keep my eye out for a potential case as well.</p>
<p>The main components is a Xilinx Spartan FPGA. The whole thing is based on the <a title="SUMP FPGA Logica Analyzer" href="http://www.sump.org/projects/analyzer/">SUMP FPGA base logic analyser</a> &#8211; so no big surprises that this is the main work horse!</p>
<p>It also has a Microchip 18F24 which looks like it is handling the USB interface.</p>
<p>The board also has several non-populated through hole headers which are for PIC ICSP, FPGA JTAG and some kind of expansion pins (as well as a set of four labelled TRG1 CK1 TRG0 and CK0). There is also a populated set of ROM ISP headers and what looks like some UART pin headers.</p>
<p>Alongside all this we have a number of indicator LEDs for ARM, Trigger, Power and USB Activity. Also some buttons for update and reset actions.</p>
<p>At the end of the board we have the analyser bus. This has a GND connection at both ends and 16 signals available for connecting flying leads to. The signals are fed into a <a title="LCX16245 Low voltage bidirectonal buffer" href="http://www.fairchildsemi.com/ds/74/74LCX16245.pdf" target="_blank">LCX16245</a> &#8211; which is a low voltage bidirectional buffer (so in theory the FPGA could drive the the signals out if you wanted to re-purpose the board!)</p>
<p>Anyway, for more detailed information on the project see the <a title="Logic Sniffer Gadget Factory page" href="http://www.gadgetfactory.net/gf/project/butterflylogic/" target="_blank">Gadget Factory page</a> &#8211; this has the <a title="Open Workbench Logic Sniffer User Guide" href="http://dangerousprototypes.com/2010/02/25/prototype-open-logic-sniffer-logic-analyzer-2/" target="_blank">user guide</a>, schematics, board design and software on it as well as installation videos and a video tutorial on UART analysis (something I will be trying soon!).</p>
<p><strong>Installation</strong></p>
<p>Once I had dug out a USB A to Mini-B cable and downloaded the software I was set to go. I had tried getting it to run on Linux (Ubuntu 10.04), but I gave up after about 20 minutes of fiddling and getting nowhere and decided to revert to good old windows XP &#8211; so if anyone has any easy to follow instructions on that one let me know!</p>
<p>After extracting the archives I plugged in the device, at which point windows requests a driver. Find the inf folder from the OpenLogic binaries archive, select that and the correct driver will be installed. This creates a virtual COM port. The number of the COM port can be found in the Device Manager (it is the one with Manufacturer = &#8220;Microchip Technology, Inc.&#8221; and Location = &#8220;Location 0 (CDC RS-232 Emulation Demo)&#8221;).</p>
<p>Once this is installed run the OB_Logic_Sniffer.exe file and you get the client.</p>
<p>Select Device -&gt; Capture and you get the Capture setup menu. This enables you to setup triggers, sampling rate and recording size.</p>
<p><strong>Testing</strong></p>
<p>To test it I grabbed my XMOS XC-3 and connected 8 of the the lines to the GPIO port (XS1_PORT_8C on Core 0). I wrote a simple XC program to simply count up in a sequence continuously in a loop at 25Mhz. Here is the setup I used for testing.</p>
<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/05/DSC04907.jpg"><img class="aligncenter size-medium wp-image-96" title="Open Workbench Logic Sniffer Test Setup" src="http://www.silly-science.co.uk/wp-content/uploads/2010/05/DSC04907-300x200.jpg" alt="Open Workbench Logic Sniffer connected to XC-3 GPIO port" width="300" height="200" /></a></p>
<p>After fiddling around wondering why Bank 1 wasn&#8217;t working, I enabled all the banks and discovered that the signals were on bank 3 (channels 16 -24). I have no idea why this is&#8230; but hey ho. It is working and the output is below.</p>
<p style="text-align: center;"><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/05/capture.png"><img class="aligncenter size-large wp-image-94" title="First Logic Sniffer Capture" src="http://www.silly-science.co.uk/wp-content/uploads/2010/05/capture-1024x240.png" alt="First Logic Sniffer Capture Showing Binary Counting Sequence" width="1024" height="240" /></a></p>
<p style="text-align: left;"><strong>Conclusion</strong></p>
<p style="text-align: left;">Overall this has the all the makings of a strong tool. It is very affordable @ $45 shipped (available from <a title="Seeed Studio Open Workbench Logic Sniffer" href="http://www.seeedstudio.com/depot/open-workbench-logic-sniffer-p-612.html?cPath=61_68" target="_blank">Seeed Studio</a>) and 16/32 channels of logic analyser @ 100MSPS is certainly not to be sniffed at.</p>
<p style="text-align: left;">Quality of the software is one of the most important things in a logic analyser as without good analysis software they are a waste of time. The Logic Sniffer doesn&#8217;t disappoint in this area- It has the capabilities to do simple single trigger or a complex 4 stage triggering and the analyser Java based client is easy and intuitive to use. While basic in the professional logic analyser world they are pretty good for most peoples needs. Extension of the triggering modes would be well worth the development time. Also simple improvements such as the ability to type in Hex values would be nice, rather than having to build a trigger mask with tick boxes.</p>
<p style="text-align: left;">Alongside the triggering features is the systems ability to analyse SPI, I2C and UART signals. Expanding this protocol analysis is something that should be actively worked on, though it has a good base (these features will hopefully be subject to another review at a later date).</p>
<p style="text-align: left;">However, the project in its entirety is currently it is a little rough around the edges. A couple of pointers for simple improvements would be:</p>
<ul>
<li>an integrated installer &#8211; especially the windows stuff. It&#8217;s a small point, but they aren&#8217;t hard to make and it makes the whole software installation process a lot less painful (rather than downloading two zips and having to extract them!)</li>
<li>a simpler firmware upgrade process ( i.e. more integrated PC side software) &#8211; the current one looks fairly daunting (even for someone like me who is a relatively experienced user of embedded hardware).</li>
</ul>
<p style="text-align: left;"><em>Over all, as an open source hacking tool, I would give this project 8/10, a few minor improvements would push it up. Open source hardware like this can be functionally good, but is often let down by the lack of polish in the user experience.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2010/05/15/open-workbench-logic-sniffer-first-impressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Energy Monitor &#8211; part 2</title>
		<link>http://www.silly-science.co.uk/2010/03/05/energy-monitor-part-2/</link>
		<comments>http://www.silly-science.co.uk/2010/03/05/energy-monitor-part-2/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 00:04:41 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Energy Monitoring]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[energy monitoring]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[xc-3]]></category>
		<category><![CDATA[xmos]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=47</guid>
		<description><![CDATA[So, now I hopefully(!) have my cable which will give me access to the UART RX of the CC128 energy monitor. Time to try it out and begin processing some data with it! Firstly, I go to the XMOS website and get the UART code and play around with it to create the UART code [...]]]></description>
			<content:encoded><![CDATA[<p>So, now I hopefully(!) have my cable which will give me access to the UART RX of the CC128 energy monitor. Time to try it out and begin processing some data with it!</p>
<p>Firstly, I go to the <a title="XMOS 2 thread UART code" href="http://www.xmos.com/applications/comms/uart-two-threads" target="_blank">XMOS website and get the UART code</a> and play around with it to create the UART code I want (RX only at the moment), compile it and give it a run.</p>
<p>But it&#8217;s never that simple! All I get are null characters. Odd I think &#8211; so I recheck the wiring, recheck the code. All seems to be ok.<br />
<span id="more-47"></span><br />
So I strip down the code to a really simple function- one that just receives a character and prints it out (see the <a href="http://www.silly-science.co.uk/wp-content/uploads/2010/03/super_simple_uart_rx.xc">Super Simple UART receive function</a> source file)</p>
<p>I still get null characters &#8211; maybe I got the wrong pins? Check again&#8230; nope, seems fine. So I decide its time to void the warranty (follow these <a title="Current Cost 'Envi' CC128 teardown" href="http://www.silly-science.co.uk/2010/03/04/current-cost-envi-cc128-teardown/" target="_blank">CC128 teardown instructions</a> at your own risk!).</p>
<p>Turns out there is a bit of solder between a via into the ground plane and the UART TX pin on the RJ45 connector (pin 8). After removing this I connected the XC-3 back up to the device and wah lah- it gives me the first character (a &#8216;&lt;&#8217;) of the XML data string.</p>
<p>Now to get the whole string out &#8211; so off I go to re-implement the more complex UART code.</p>
<p>After some battling I got it running!</p>
<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/03/uart_working.jpg"><img class="aligncenter size-medium wp-image-65" title="UART Data RX working" src="http://www.silly-science.co.uk/wp-content/uploads/2010/03/uart_working-300x187.jpg" alt="UART Data RX working" width="300" height="187" /></a>The output looks like the following is in line with the <a title="CC128 Energy Monitor XML Documentation" href="http://www.currentcost.com/cc128/xml.htm" target="_blank">CC128 XML documentation</a>.</p>
<p>Next time&#8230; parse the XML and output to somewhere a little more useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2010/03/05/energy-monitor-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Energy Monitor &#8211; Part 1</title>
		<link>http://www.silly-science.co.uk/2010/03/03/energy-monitor-part-1/</link>
		<comments>http://www.silly-science.co.uk/2010/03/03/energy-monitor-part-1/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 23:20:59 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Energy Monitoring]]></category>
		<category><![CDATA[energy monitoring]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[xc-3]]></category>
		<category><![CDATA[xmos]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=37</guid>
		<description><![CDATA[My energy monitor arrived today! It&#8217;s working well &#8211; I was slightly worried about how good the reception would be for the transmitter, but I am pleasantly surprised that even with the receiver 3 floors above the transmitter it seems to register a good signal. But that&#8217;s boring &#8211; time to start hacking! So, first thing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04890_small.jpg"><img class="alignright size-medium wp-image-38" title="Energy Monitor Display" src="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04890_small-213x300.jpg" alt="Energy Monitor Display" width="149" height="210" /></a>My energy monitor arrived today! It&#8217;s working well &#8211; I was slightly worried about how good the reception would be for the transmitter, but I am pleasantly surprised that even with the receiver 3 floors above the transmitter it seems to register a good signal.</p>
<p>But that&#8217;s boring &#8211; time to start hacking!</p>
<p>So, first thing I need is the interface cable. The back of the unit has a handy RJ45 connector that has serial in it (see my <a title="Energy Monitoring Ideas post" href="http://www.silly-science.co.uk/2010/02/25/energy-monitoring/" target="_blank">initial energy monitoring post</a>). This needs connecting to my XC-3 kit so that I can begin to get the data out of it. So time to get the soldering iron out!</p>
<p><span id="more-37"></span>So, initially all I need are two wires from the RJ45 network cable (standard network wiring configuration)-</p>
<ul>
<li>Brown = the UART transmit (from the energy monitor)</li>
<li>Blue = ground</li>
</ul>
<p>I soldered the rest of them onto the strip board in case I wish to use them later and it keeps things neat and tidy.</p>
<p>For the moment I am using the the GPIO port on the XC-3, using pin 1 for a 1 bit port (XCore UART RX) and pin 16 is ground. This should give a good base from which to work. Eventually I would like to put it on the LED connectors to keep the GPIO free. The other bonus of using the LED connector is that the output side is buffered up to 5V which is what the UART on the energy monitor needs &#8211; though I think I will have a check of the Microchip PIC they use inside and see if it will take 3.3V logic levels.</p>
<p>Next time&#8230; getting data into the XC-3</p>
<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04887_small.jpg"><img class="aligncenter size-medium wp-image-39" title="XC-3 and the connection strip board" src="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04887_small-300x200.jpg" alt="XC-3 and the connection board" width="300" height="200" /></a></p>
<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04888_small.jpg"><img class="aligncenter size-medium wp-image-40" title="Stripboard &quot;Connector&quot;" src="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04888_small-300x200.jpg" alt="Stripboard &quot;Connector&quot;" width="300" height="200" /></a></p>
<p><a href="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04889_small.jpg"><img class="aligncenter size-medium wp-image-41" title="XC-3 Connection" src="http://www.silly-science.co.uk/wp-content/uploads/2010/03/DSC04889_small-300x200.jpg" alt="XC-3 Connection" width="300" height="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2010/03/03/energy-monitor-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Energy Monitoring</title>
		<link>http://www.silly-science.co.uk/2010/02/25/energy-monitoring/</link>
		<comments>http://www.silly-science.co.uk/2010/02/25/energy-monitoring/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 11:37:45 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Energy Monitoring]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[energy monitoring]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[xc-2]]></category>
		<category><![CDATA[xc-3]]></category>
		<category><![CDATA[xmos]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=30</guid>
		<description><![CDATA[Was at a friends today and he showed me an energy monitor that he had bought and was using to monitor his electricity supply. I was like &#8220;hmm&#8230; this could be something fun to attach to an XCore and get some graphs out of&#8221;. My thought is to use my XC-3 (or maybe get an [...]]]></description>
			<content:encoded><![CDATA[<p>Was at a friends today and he showed me an energy monitor that he had bought and was using to monitor his electricity supply. I was like &#8220;hmm&#8230; this could be something fun to attach to an XCore and get some graphs out of&#8221;.</p>
<p>My thought is to use my XC-3 (or maybe get an XC-2) to connect to an energy monitor receiver &#8211; or hack/make a receiver and then push the data somewhere useful via Ethernet. In fact I could combine it with my <a title="Silly Science Embedded Traffice Monitor" href="http://www.silly-science.co.uk/2009/12/21/embedded-traffic-monitor/" target="_blank">network monitor</a>, ditch the screen and have it push the all the different types of data out into some nice pretty graphs. Anyway, enough brain dump &#8211; onto the hardware!</p>
<p><span id="more-30"></span></p>
<p>My proposal is to use a <a title="Current Cost Envi 128" href="http://www.currentcost.com/product-cc128.html" target="_blank">Current Cost Envi (CC128)</a> device. There is a helpful <a title="dale lane CC128 Envi write up" href="http://dalelane.co.uk/blog/?p=389" target="_blank">CC128 write up from dale lane</a>. It has several nice features:</p>
<ol>
<li>The receiver has a RS232 output</li>
<li>The receiver outputs XML from the RS232</li>
<li>The system has support for up to 9 individual appliance monitoring (IAMs)</li>
</ol>
<p>Some thoughts on software/graphing features:</p>
<ul>
<li>Display a comprehensive history (device can output real-time, or 2hr block data)</li>
<li>Calculate some averages (particularly for time of day, month, season)</li>
<li>Plot electricity use vs. temperature? &#8211; the relationship should be pretty obvious&#8230; but I like pretty graphs</li>
<li>Plot the electricity generation stats and calculate my carbon footprint (ooh err!) &#8211; see <a title="Amee electricity generation stats" href="http://wiki.amee.com/index.php/Real_Time_Electricity#UK_National_Grid_Data_and_RealtimeCarbon.org" target="_blank">Amee</a></li>
</ul>
<p>Could even add some<a title="X10 PLC interface" href="http://www.uk-automation.co.uk/marmitek-x10-twoway-plc-interface-xm10-ttlcmos-interface-p-1349.html" target="_blank"> X10 stuff in there</a> to&#8230; the possibilities are endless &#8211; watch this space!</p>
<p>Update: <a title="CC128 Connector pinout" href="http://www.techtoniq.com/forum/viewtopic.php?f=5&amp;t=385" target="_blank">CC128 connector pinout</a>- looks like you might be able to reprogram the internal PIC as well!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2010/02/25/energy-monitoring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lasers and Submarines</title>
		<link>http://www.silly-science.co.uk/2010/02/20/lasers-and-submarines/</link>
		<comments>http://www.silly-science.co.uk/2010/02/20/lasers-and-submarines/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 16:45:22 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Other Peoples Projects]]></category>
		<category><![CDATA[lasers]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[underwater]]></category>
		<category><![CDATA[xk-1]]></category>
		<category><![CDATA[xmos]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=25</guid>
		<description><![CDATA[Over the last few weeks I have come across some nice XMOS based projects: 1) Laser Cutter Not massively complex in terms of software &#8211; but a pretty cool outcome. UART in &#8211; granite engravings out! Nice&#8230; Maybe an ethernet interface with a web client to upload images into it could come next&#8230; laser engraver [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last few weeks I have come across some nice XMOS based projects:</p>
<p>1) <a title="XMOS CNC Laser Cutter" href="http://www.buildlog.net/cnc_laser/xmos_controller.html" target="_blank">Laser Cutter</a></p>
<p>Not massively complex in terms of software &#8211; but a pretty cool outcome. UART in &#8211; granite engravings out! Nice&#8230; Maybe an ethernet interface with a web client to upload images into it could come next&#8230;<a title="XMOS laser engraver source code" href="http://github.com/bdring/XMOS_ctrl" target="_blank"> laser engraver source code here</a></p>
<p>2) <a title="Aquatic Bot Explorer" href="http://letsmakerobots.com/node/17222" target="_blank">Aquatic Bot Explorer (ABE)</a></p>
<blockquote><p>The main purpose of the project it&#8217;s to create an autonomus vehicle to explore lakes and reefs. Aquatic Bot Explorer (ABE) its based on a ROV (Remotely Operated underwater Vehicles ) and AUV (Autonomus Underwater Vehicles ) class robots.<br />
This bot it&#8217;s powered by an XK-1 processor by XMOS, several boards for sensing: pressure, temperature, depth, etc. Motor control, demux, ADC, etc. are developed.</p></blockquote>
<p>Looks pretty cool&#8230; can&#8217;t wait to see what it turns up from the depths!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2010/02/20/lasers-and-submarines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XMOS XS-1 Virtual Threads</title>
		<link>http://www.silly-science.co.uk/2010/02/01/xmos-xs-1-virtual-threads/</link>
		<comments>http://www.silly-science.co.uk/2010/02/01/xmos-xs-1-virtual-threads/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 15:21:36 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[XCore/XMOS Virtual Threads]]></category>
		<category><![CDATA[context switch]]></category>
		<category><![CDATA[interrupts]]></category>
		<category><![CDATA[xmos]]></category>
		<category><![CDATA[xs-1]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=19</guid>
		<description><![CDATA[The XMOS XS-1 architecture is a multi-threaded architecture. As opposed to normal systems it has a single processor core that can run 8 hardware threads, in real-time with no operating system overhead. But what happens if you run out of threads&#8230; 2 answers: either (1) add more cores or (2) virtualize. So I thought I [...]]]></description>
			<content:encoded><![CDATA[<p>The XMOS XS-1 architecture is a multi-threaded architecture. As opposed to normal systems it has a single processor core that can run 8 hardware threads, in real-time with no operating system overhead. But what happens if you run out of threads&#8230; 2 answers: either (1) add more cores or (2) virtualize.</p>
<p>So I thought I would do option (2) as option (1) is too easy in the XMOS architecture and its not very efficient if I want to run 1MIPs processes on a thread that has 50MIPs available. The code for this is freely available from the <a title="XS-1 Virtual Threads sourceforge page" href="http://sourceforge.net/projects/vthreads/" target="_blank">virtual threads sourceforge page</a>.</p>
<p>More information after the break&#8230;</p>
<p><span id="more-19"></span></p>
<p>The base of the system is simple <a title="Wikipedia's explanation of context switching" href="http://en.wikipedia.org/wiki/Context_switching" target="_blank">context switching</a> within a single thread &#8211; this allows multiple processes to be run on a single thread. The current implementation has only time-slicing for processes and doesn&#8217;t currently have any way to handle events, ports or channels in a sensible way. Hopefully this soft of thing will be implemented when I spend some more time on the project.</p>
<p>The tricky things to handle are those which I haven&#8217;t implemented yet&#8230; The risk of deadlocking the whole lot of virtual threads is quite high when working with events or waiting for external stimulus. Essentially a carefully implemented library would have to be used to stop this, but still provide the level of functionality you get using the hardware threads.</p>
<p>Its probably fairly safe to assert that the virtual threads will not ever be able to be as functional as the hardware threads.</p>
<p>So, a summary of current features:</p>
<ul>
<li>Able to start an arbitrary number of virtual threads</li>
<li>Simple time sliced context switching of virtual threads</li>
<li>Ability to disable the interrupt for atomic operation</li>
</ul>
<p>Future features:</p>
<ul>
<li>Context switch on external stimulus</li>
<li>Context switch on demand (so a virtual thread can &#8220;release&#8221; itself from the current hardware thread)</li>
<li>Implementation of access to events, channel comms, hardware</li>
<li>Call to allocate stack space to vthread</li>
<li>More flexible vthread params (ports, chans, etc)</li>
</ul>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2010/02/01/xmos-xs-1-virtual-threads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedded Traffic Monitor</title>
		<link>http://www.silly-science.co.uk/2009/12/21/embedded-traffic-monitor/</link>
		<comments>http://www.silly-science.co.uk/2009/12/21/embedded-traffic-monitor/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 13:40:04 +0000</pubDate>
		<dc:creator>silly-scientist</dc:creator>
				<category><![CDATA[Embedded Network Monitor]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[spi]]></category>
		<category><![CDATA[vfd]]></category>
		<category><![CDATA[xc-3]]></category>
		<category><![CDATA[xmos]]></category>

		<guid isPermaLink="false">http://www.silly-science.co.uk/?p=3</guid>
		<description><![CDATA[This is the initial release of the embedded traffic monitor which I implemented on an XMOS XC-3 development kit. It has a 256&#215;32 VFD attached to it with a custom board that was designed from another application (hence the buttons/IR sensor you&#8217;ll notice if you are observant). Full source code is available from the embedded [...]]]></description>
			<content:encoded><![CDATA[<p>This is the initial release of the <a title="Embedded Traffic Monitor (Sourceforge)" href="http://sourceforge.net/projects/embeddednetmon/" target="_blank">embedded traffic monitor</a> which I implemented on an XMOS XC-3 development kit. It has a <a title="256x32 VFD Datasheet" href="http://www.farnell.com/datasheets/14280.pdf" target="_blank">256&#215;32 VFD</a> attached to it with a custom board that was designed from another application (hence the buttons/IR sensor you&#8217;ll notice if you are observant). Full source code is available from the <a title="XC-3 embedded traffic monitor sourceforge page" href="http://sourceforge.net/projects/embeddednetmon/" target="_blank">embedded traffic monitor sourceforge page</a>.</p>
<p>More information and pictures after the break&#8230;</p>
<p><span id="more-3"></span></p>
<p>The basic premise of the system is that data comes in and then goes out the other side (to general traffic the device looks like a wire) and information about that traffic collected on its way through (so at the moment it just looks at packet byte length). The data is then aggregated appropriately with the throughput being averaged over a second (sample at an interval of 100mS).</p>
<p>The information as well as being displayed on screen (via a simple I2C bus) is stored to an SPI flash once every 10s. This is so that if power is lost then the logged data is not.</p>
<p>Current Feature Summary:</p>
<ul>
<li>Dual MII ethernet interface</li>
<li>I2C VFD for showing the resulting information</li>
<li>Saving of data to on-board SPI flash memory</li>
</ul>
<p>Future features:</p>
<ul>
<li>Internal switch for custom applications (so you can access the device over IP)</li>
<li>A web interface to allow a user to reset stored data and maybe produce a SVG graph?</li>
<li>Change display for lower cost, lower power OLED? (Farnell order code: 1498842)</li>
</ul>
<p>And some pictures:</p>
<div id="attachment_6" class="wp-caption aligncenter" style="width: 394px"><a href="http://www.silly-science.co.uk/wp-content/uploads/2009/12/screenshot0.jpg"><img class="size-full wp-image-6 " title="XC-3 Network Monitor and Display" src="http://www.silly-science.co.uk/wp-content/uploads/2009/12/screenshot0.jpg" alt="XC-3 Network Monitor and Display" width="384" height="257" /></a><p class="wp-caption-text">XC-3 Network Monitor and Display</p></div>
<div id="attachment_5" class="wp-caption aligncenter" style="width: 394px"><a href="http://www.silly-science.co.uk/wp-content/uploads/2009/12/screenshot1.jpg"><img class="size-full wp-image-5 " title="Network Monitor Display" src="http://www.silly-science.co.uk/wp-content/uploads/2009/12/screenshot1.jpg" alt="Network Monitor Display showing a graph and data rates" width="384" height="257" /></a><p class="wp-caption-text">Network Monitor Display showing a graph and data rates</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.silly-science.co.uk/2009/12/21/embedded-traffic-monitor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
