<?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; serial</title>
	<atom:link href="http://www.silly-science.co.uk/tag/serial/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>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>
	</channel>
</rss>
