<?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>ShareBrained Technology</title>
	<atom:link href="http://www.sharebrained.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharebrained.com</link>
	<description>Electronics for Curious Brains</description>
	<lastBuildDate>Wed, 22 May 2013 01:18:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Radio Spectrum Analyzer at Maker Faire</title>
		<link>http://www.sharebrained.com/2013/05/21/maker-faire-radio-spectrum-analyzer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=maker-faire-radio-spectrum-analyzer</link>
		<comments>http://www.sharebrained.com/2013/05/21/maker-faire-radio-spectrum-analyzer/#comments</comments>
		<pubDate>Wed, 22 May 2013 01:18:07 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hackrf]]></category>
		<category><![CDATA[maker faire]]></category>
		<category><![CDATA[open hardware]]></category>
		<category><![CDATA[radio]]></category>
		<category><![CDATA[software-defined radio]]></category>
		<category><![CDATA[spectrum analyzer]]></category>
		<category><![CDATA[vacuum fluorescent display]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=1006</guid>
		<description><![CDATA[For Maker Faire, I cobbled together a last-minute radio spectrum analyzer out of a HackRF software-defined radio and a giant vacuum fluorescent display. <a href="http://www.sharebrained.com/2013/05/21/maker-faire-radio-spectrum-analyzer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some details of my radio spectrum analyzer hack at Maker Faire. But first, a quick video of the hack in action:</p>
<p><iframe width="640" height="480" src="http://www.youtube.com/embed/rmVu_mw3aJU" frameborder="0" allowfullscreen></iframe></p>
<h2>Technical Details</h2>
<p>This project is built around the <a href="http://greatscottgadgets.com/hackrf/">HackRF</a>, a software-defined radio transciever. I programmed it to sample 20MHz of radio spectrum from an antenna, do a frequency analysis on the data, and display the results on a Noritake vacuum fluorescent display. I added the tuning wheel mid-afternoon on Sunday, and it really improved the interactivity of the display. It felt really cool to spin the wheel around and watch the spectrum scroll back and forth. Too bad I didn&#8217;t capture that in the video&#8230;</p>
<p><a href="http://www.sharebrained.com/wp-content/2013/05/radio-spectrum-analyzer1-e1369184474197.jpg"><img src="http://www.sharebrained.com/wp-content/2013/05/radio-spectrum-analyzer1-e1369184474197-420x560.jpg" alt="" title="Radio Spectrum Analyzer at Maker Faire 2013" width="420" height="560" class="aligncenter size-medium wp-image-1009" /></a></p>
<p>The HackRF&#8217;s microcontroller is an <a href="http://www.nxp.com/products/microcontrollers/cortex_m4/LPC4330FBD144.html">ARM Cortex-M4F + Cortex-M0 &#8220;dual core&#8221; chip</a>. Both are running at 204MHz. The M4F has hardware floating point, which drastically simplifies the signal processing code.</p>
<p>The ARM grabs 512 complex samples at a time from the radio analog-to-digital converter (ADC). It applies a <a href="http://en.wikipedia.org/wiki/Window_function">window function</a> that reduces artifacts from sampling arbitrary chunks of a radio signal. The windowed samples are converted to <a href="http://en.wikipedia.org/wiki/Frequency_domain">frequency domain</a> data through a 512-point <a href="http://en.wikipedia.org/wiki/Fft">fast-Fourier transform (FFT)</a>. The frequency data that comes out of the FFT (frequency vs. a <a href="http://en.wikipedia.org/wiki/Complex_numbers">complex</a> vector) is converted to real magnitudes. I take the <a href="http://en.wikipedia.org/wiki/Logarithm">logarithm</a> of each magnitude to get values vs. frequency that resemble <a href="http://en.wikipedia.org/wiki/Decibel">decibels</a>. Then, I scale the log-magnitude data to fit nicely on the <a href="http://noritake-vfd.com/gu384x32l-3900.aspx">vacuum fluorescent display</a>, which is 384 x 32 pixels. For each frequency in the scaled data, I render a bar into a frame buffer I maintain in RAM, using cute bit-shifting tricks. Then, I render marks at 1MHz intervals to provide a tick-mark scale on the display. In the left corner of the display, I render minimum and maximum sample buffer values for each of the two sampling channels &#8212; this is so I can tell if I need to turn up or down the gain on the receiver. I draw the current tuning frequency in MHz at the center of the display. Lastly, I scan out each of the pixels, one byte at a time, into the VFD&#8217;s parallel 8-bit interface, using the display&#8217;s &#8220;Graphic DMA&#8221; mode.</p>
<p>The optical <a href="http://en.wikipedia.org/wiki/Rotary_encoder#Single-track_Gray_encoding">quadrature encoder</a> runs purely on interrupts. Whenever a positive- or negative-going edge is detected on either of the two optical sensors, an interrupt is generated. Based on the current and previous values of the optical sensors, the software (borrowed from <a href="http://www.pjrc.com/teensy/td_libs_Encoder.html">PJRC&#8217;s Encoder Library</a>) decides if the wheel has moved, and if so, which way it has moved. Based on that decision, the tuning frequency is incremented or decremented.</p>
<p>There was a hairy bit of wiring between the HackRF and the VFD. I needed to interface the HackRF, which is a 3.3 Volt device, to the VFD, which communicates at 5 Volts. So I needed to translate several signals between those two voltages. I had an old circuit board from my <a href="https://github.com/sharebrained/robotron-fpga">Robotron-FPGA project</a> that did exactly that, for a completely different purpose. But with enough wires and headers and disgusting rewiring, I made it work. But it wasn&#8217;t pretty. I had to keep poking it and twisting it, as some signals were intermittent and sometimes needed my help.</p>
<h2>The Faire Experience</h2>
<p>The HackRF can tune from below 10MHz (where it&#8217;s mostly amateur radio and AM radio stations), up through 6GHz. That includes *almost* every signal in common use. Until I added the tuning dial, I left the HackRF at about 840MHz, right in the middle of one of the cellular (mobile phone) bands. As you&#8217;d imagine, lots of cellular phones were in use at Maker Faire, so a lot of signals were jumping about on the display. People who really got the display would soon pull out their phones to make a call. Most of the time, their phones were operating in other cellular bands, but a few times we got lucky and could clearly see activity that came and went depending on whether they were in a call or not.</p>
<p>Late Saturday, a couple of <a href="http://en.wikipedia.org/wiki/Amateur_radio_operator">hams (amateur radio operators)</a> came by with their portable radio transcievers. I tuned the HackRF up to 440MHz and we could see peaks when they were transmitting. They were amused&#8230;</p>
<p>The first half of Sunday, I attached the optical encoder wheel and wired up the optical interrupters to the HackRF. The wheel was laser cut acrylic, cut before I left for Maker Faire. I cut a bunch of different designs, since I wasn&#8217;t sure exactly how everything would fit together ahead of time. The wheel was mounted on a <a href="http://en.wikipedia.org/wiki/Lazy_Susan">Lazy Susan</a> apparatus I bought at a hardware store. I drilled the wheel assembly to my display whiteboard, and then started attaching the optical interruptors with hot glue. Unfortunately, I needed a couple of 470 Ohm through-hole resistors to control the current through the interruptors&#8217; LEDs, but I didn&#8217;t bring *any* resistors with me. So I went begging at the Radio Shack &#8220;Learn to Solder&#8221; tent, and they were kind enough to bust open one of their $60 electronics kits to give me $0.07 worth of resistors. While I was gone, somebody had forcefully cranked the wheel and broken off several of the teeth. I should&#8217;ve seen that coming! Fortunately, I had lots of other options from my laser cutting binge. I settled on a sandwich, consisting of the tooth pattern cut in paper with clear thin plastic on either side.</p>
<p>Once I got the encoder software working, I added a frequency display in the middle of the VFD. People would walk up and give the wheel a spin, looking around for interesting signals. There&#8217;s a lot of underutilized spectrum (at least where we were), so it wasn&#8217;t too exciting outside the cellular and 2.4GHz bands. The environment was also quite electrically noisy, so with a fairly insensitive receiver, long-distance bands (e.g. aviation) didn&#8217;t really show anything &#8212; those weaker signals were jammed by all the motors and <a href="http://blog.makezine.com/2013/05/19/arcattacks-steve-ward-demos-the-handheld-tesla-coil/">Tesla coils</a> nearby. I&#8217;m sure my antenna also wasn&#8217;t the best&#8230;</p>
<p>Despite the last-minute additions and general hackiness of the project, I had a lot of fun building it and talking with people about it. Events like Maker Faire are great as a reminder that you&#8217;re not the only person in the world who likes to nerd out on such obscure things!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/05/21/maker-faire-radio-spectrum-analyzer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My First 8-Layer PCB</title>
		<link>http://www.sharebrained.com/2013/05/21/my-first-8-layer-pcb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-first-8-layer-pcb</link>
		<comments>http://www.sharebrained.com/2013/05/21/my-first-8-layer-pcb/#comments</comments>
		<pubDate>Tue, 21 May 2013 23:35:26 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[daisho]]></category>
		<category><![CDATA[fpga]]></category>
		<category><![CDATA[kicad]]></category>
		<category><![CDATA[open hardware]]></category>
		<category><![CDATA[pcb]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=1001</guid>
		<description><![CDATA[I recently completed my first 8-layer PCB design, for Michael Ossmann&#8217;s Daisho project. Among the challenges: a 780-pin Altera Cyclone IV FPGA, a USB 3.0 chip with 0.8mm ball spacing, very high-speed parallel and serial buses, tight power constraints, and &#8230; <a href="http://www.sharebrained.com/2013/05/21/my-first-8-layer-pcb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently completed my first 8-layer PCB design, for Michael Ossmann&#8217;s <a href="http://ossmann.blogspot.com/2013/05/introducing-daisho.html">Daisho project</a>. Among the challenges: a 780-pin Altera Cyclone IV FPGA, a USB 3.0 chip with 0.8mm ball spacing, very high-speed parallel and serial buses, tight power constraints, and keeping the cost down. Oh, and did I mention I was using only open-source schematic and PCB tools (KiCAD)?</p>
<p>It&#8217;s back from manufacturing, and the first few subsystems are being assembled. Any bets on whether it&#8217;ll work the first time? :-)</p>
<div id="attachment_1002" class="wp-caption aligncenter" style="width: 570px"><a href="http://www.sharebrained.com/wp-content/2013/05/daisho-main-board-pcb.jpg"><img src="http://www.sharebrained.com/wp-content/2013/05/daisho-main-board-pcb-560x420.jpg" alt="" title="Daisho Main Board PCB, unassembled" width="560" height="420" class="size-medium wp-image-1002" /></a><p class="wp-caption-text">First fabricated Daisho project main boards are back from manufacturing.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/05/21/my-first-8-layer-pcb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Robotron: CoR Style</title>
		<link>http://www.sharebrained.com/2013/05/21/robotron-cor-style/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=robotron-cor-style</link>
		<comments>http://www.sharebrained.com/2013/05/21/robotron-cor-style/#comments</comments>
		<pubDate>Tue, 21 May 2013 23:21:32 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[church of robotron]]></category>
		<category><![CDATA[fpga]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[maker faire]]></category>
		<category><![CDATA[retro]]></category>
		<category><![CDATA[robotron]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=995</guid>
		<description><![CDATA[This gentleman is clearly a devotee of the Church of Robotron.]]></description>
			<content:encoded><![CDATA[<p>This gentleman is clearly a devotee of the <a href="http://www.churchofrobotron.com/">Church of Robotron</a>.</p>
<div id="attachment_996" class="wp-caption aligncenter" style="width: 430px"><a href="http://www.sharebrained.com/wp-content/2013/05/robotron-mcor-style.jpg"><img src="http://www.sharebrained.com/wp-content/2013/05/robotron-mcor-style-420x560.jpg" alt="" title="Robotron, CoR Style" width="420" height="560" class="size-medium wp-image-996" /></a><p class="wp-caption-text">Maker Faire attendee knows proper Robotron playing style.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/05/21/robotron-cor-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maker Faire 2013</title>
		<link>http://www.sharebrained.com/2013/05/21/maker-faire-2013/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=maker-faire-2013</link>
		<comments>http://www.sharebrained.com/2013/05/21/maker-faire-2013/#comments</comments>
		<pubDate>Tue, 21 May 2013 21:40:28 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hackrf]]></category>
		<category><![CDATA[maker faire]]></category>
		<category><![CDATA[retro]]></category>
		<category><![CDATA[robotron]]></category>
		<category><![CDATA[software-defined radio]]></category>
		<category><![CDATA[vacuum fluorescent display]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=990</guid>
		<description><![CDATA[I showed two hacks at Maker Faire: The HackRF radio spectrum analyzer, and Robotron on an FPGA. More details soon! Until then, here are some links. <a href="http://www.sharebrained.com/2013/05/21/maker-faire-2013/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I showed two hacks this year: The HackRF radio spectrum analyzer, and Robotron on an FPGA. More details soon! Until then, here are links to more information:</p>
<ul>Radio Spectrum Analyzer:</p>
<li><a href="http://greatscottgadgets.com/hackrf/">HackRF Software-Defined Radio</a></li>
<li><a href="http://noritake-vfd.com/gu384x32l-3900.aspx"> Noritake GU384X32L-3900</a> vacuum fluorescent display, for sale, cheap!</li>
</ul>
<ul>Robotron on an FPGA:</p>
<li><a href="https://github.com/sharebrained/robotron-fpga">Robotron-FPGA project</a> source code and MC6809E adapter board design</li>
<li><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&#038;storeId=10001&#038;productId=43545&#038;catalogId=10001&#038;CID=MERCH">Motorola MC6809E microprocessor</a> on sale at Jameco</li>
<li><a href="http://www.robotron-2084.co.uk/manualsrobotron.html">Robotron: 2084 Schematics</a></li>
<li><a href="http://digilentinc.com/Products/Detail.cfm?NavPath=2,400,789&#038;Prod=NEXYS2">Digilent Nexys 2</a> FPGA board</li>
<li><a href="http://na.suzohapp.com/all_catalogs/joysticks/50-6084-000">Suzo-Happ Super Joystick</a></li>
</ul>
<p>Leave a comment if you have questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/05/21/maker-faire-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sailing the I2Cs with the Bus Pirate</title>
		<link>http://www.sharebrained.com/2013/02/26/sailing-the-i2cs-with-the-bus-pirate/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sailing-the-i2cs-with-the-bus-pirate</link>
		<comments>http://www.sharebrained.com/2013/02/26/sailing-the-i2cs-with-the-bus-pirate/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 19:37:06 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Random Stuff I Learned]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[dorkbot]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[open hardware]]></category>
		<category><![CDATA[prototyping]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=982</guid>
		<description><![CDATA[A presentation on exploring I2C hardware with the Bus Pirate. <a href="http://www.sharebrained.com/2013/02/26/sailing-the-i2cs-with-the-bus-pirate/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while ago, I spoke at Dorkbot PDX about using the Bus Pirate to explore devices with I2C interfaces. I&#8217;ve been remiss in posting my slides from that talk, so here they are:</p>
<p><a href='http://www.sharebrained.com/wp-content/2013/02/i2c_dorkbotpdx_0x08.pdf'>I2C @ Dorkbot PDX 0&#215;08</a></p>
<p><a href='http://www.sharebrained.com/wp-content/2013/02/i2c_dorkbotpdx_0x08.pdf'><img src="http://www.sharebrained.com/wp-content/2013/02/I2C.001-560x420.jpg" alt="" title="I2C @ Dorkbot PDX 0x08" width="560" height="420" class="aligncenter size-medium wp-image-984" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/02/26/sailing-the-i2cs-with-the-bus-pirate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use The Source! Linux kfifo Rocks.</title>
		<link>http://www.sharebrained.com/2013/02/21/use-the-source-linux-kfifo-rocks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-the-source-linux-kfifo-rocks</link>
		<comments>http://www.sharebrained.com/2013/02/21/use-the-source-linux-kfifo-rocks/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 21:17:47 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Random Stuff I Learned]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[fifo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[modular arithmetic]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=979</guid>
		<description><![CDATA[Are you an embedded developer? There's a lot of great code to learn from in the Linux kernel, starting with their FIFO implementation. <a href="http://www.sharebrained.com/2013/02/21/use-the-source-linux-kfifo-rocks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In embedded software development, there&#8217;s frequently a need for a <a href="http://en.wikipedia.org/wiki/FIFO">FIFO</a> implementation. Right now, I need to buffer data between my <a href="http://www.ti.com/product/cc3000">CC3000 Wi-Fi module</a> and an HTTP parser. The CC3000 most efficiently delivers data from a Web server in large blocks (&#8220;large&#8221; in the embedded world meaning 256 bytes or more). But my HTTP parser will want to consume received data in single-byte increments &#8212; looking for breaks between header lines, for instance. So I need something between the two entities to hold on to the extra data that comes out of the CC3000 while the HTTP parser is doing its work. That&#8217;s where a FIFO comes in. I can read large blocks from the CC3000 when the FIFO gets empty, filling it back up, and the HTTP parser can grab bytes one at a time.</p>
<p>I had the (perhaps obvious) thought that the Linux kernel developers must also need FIFOs. Sure enough, they have a FIFO implementation called &#8220;<a href="http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=kernel/kfifo.c">kfifo</a>&#8220;. And what an implementation! Through an exceptionally elegant trick of <a href="http://en.wikipedia.org/wiki/Modular_arithmetic">modular arithmetic</a>, the code is so simple, it&#8217;s almost non-existent.</p>
<p>A FIFO needs to keep two indexes into a buffer array &#8212; an &#8220;in&#8221; index to where data is added to the FIFO, and an &#8220;out&#8221; index to where data is removed from the FIFO. When data is added, the data is placed at the &#8220;in&#8221; index of the array, and the &#8220;in&#8221; index is incremented. When data is removed from the FIFO, data is obtained from &#8220;out&#8221; index in the array, and the &#8220;out&#8221; index is incremented. This works just fine until the &#8220;in&#8221; and &#8220;out&#8221; indexes go past the end of the array. So you have to add code to check the &#8220;in&#8221; and &#8220;out&#8221; indexes after you increment them, and wrap them around to the start of the array when they go past the end. It&#8217;s also important to prevent adding new data if the FIFO is full, and prevent removing data if the FIFO is empty. More code, more conditionals, more spaghetti.</p>
<p>The kfifo code simplifies all those concerns. Instead of checking for &#8220;in&#8221; and &#8220;out&#8221; going past the end of the buffer array, it just lets them keep growing past the end. By observing that the wrap-around is just a form of modular arithmetic, and by requiring kfifos to have a length that&#8217;s a power of two, they can take the &#8220;in&#8221; and &#8220;out&#8221; indexes and <a href="http://en.wikipedia.org/wiki/Logical_and">logically-AND</a> them with a bit mask that&#8217;s the length of the array minus 1. This turns an index into the value it would&#8217;ve been had you done the bounds checking and wrapping I described above. And because the &#8220;in&#8221; and &#8220;out&#8221; indexes no longer wrap, you don&#8217;t need complex code to calculate the difference between &#8220;in&#8221; and &#8220;out&#8221; to know how full the FIFO is &#8212; you just subtract &#8220;out&#8221; from &#8220;in&#8221;! But wait! What if you get to the point where &#8220;in&#8221; and &#8220;out&#8221; are so large that they wrap around the maximum value for their data type (probably an unsigned 32-bit or 64-bit integer)? Well, modular arithmetic again saves the day. If &#8220;in&#8221; equals 10 and &#8220;out&#8221; equals 2^32 &#8211; 10 (4294967286), and you subtract &#8220;out&#8221; from &#8220;in&#8221; using 32-bit math, you get&#8230; 20! How cool is that?!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/02/21/use-the-source-linux-kfifo-rocks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WiFi Module For $10?</title>
		<link>http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wifi-module-for-10-dollars</link>
		<comments>http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 20:29:57 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Random Stuff I Learned]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[cc3000]]></category>
		<category><![CDATA[monulator]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[wi-fi]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=964</guid>
		<description><![CDATA[A Wi-Fi module for $10? Texas Instruments CC3000! I'm getting to know it, and it's a quirky product. Not as much the product, as how TI is choosing to support it. <a href="http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last July, I experimented with adding Wi-Fi to the Monulator prototype. With Wi-Fi, a Monulator wouldn&#8217;t need to be plugged in to a PC to retrieve information. So far, it&#8217;s working great! I have a Monulator that&#8217;s scraping a NASA Web site every five minutes, indicating how likely it is I can see an <a href="http://en.wikipedia.org/wiki/Aurora_borealis">aurora borealis</a> where I live. (Sadly, no auroras yet &#8212; they&#8217;re very rarely visible at 45 N latitude.)</p>
<div id="attachment_965" class="wp-caption aligncenter" style="width: 430px"><a href="http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/img_1968/" rel="attachment wp-att-965"><img src="http://www.sharebrained.com/wp-content/2013/02/IMG_1968-420x560.jpg" alt="" title="What&#039;s the Space Weather Today?" width="420" height="560" class="size-medium wp-image-965" /></a><p class="wp-caption-text">Look Ma, no host! The Monulator displays the current aurora Kp index.</p></div>
<p>The one bummer about adding Wi-Fi to the Monulator is that it&#8217;s expensive. The <a href="http://www.rovingnetworks.com/products/RN171XV">Roving Networks (now Microchip) RN171XV module</a> is about $30 US in quantity, which is simply too much. But then I stumbled across the <a href="http://www.ti.com/product/cc3000">TI CC3000 Wi-Fi module</a>. It&#8217;ll do 802.11b/g in the 2.4GHz spectrum, for only $10 US in quantity. It&#8217;s exciting to think I could add Wi-Fi capability to the Monulator for a modest incremental cost!</p>
<p>I got a development board a couple of weeks ago, and have struggled mightily to get the CC3000 to talk with an ARM microcontroller and my Web server. But I have made real progress!</p>
<div id="attachment_967" class="wp-caption aligncenter" style="width: 570px"><a href="http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/img_1973/" rel="attachment wp-att-967"><img src="http://www.sharebrained.com/wp-content/2013/02/IMG_1973-560x420.jpg" alt="" title="CC3000 ARM Driver Development" width="560" height="420" class="size-medium wp-image-967" /></a><p class="wp-caption-text">My rig for developing CC3000 driver code &#8212; CC3000 module, LPC11U14 dev board, Black Magic Probe, Bus Pirate, and HackRF (serving as a high-current power supply).</p></div>
<p>The CC3000 does not use a serial/UART interface like most of the other Wi-Fi modules. The CC3000 talks <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a>. This is great, because SPI can transfer data very quickly (16MHz on the CC3000). SPI is also transfer-oriented, so sending and receiving commands is (arguably) simpler than managing command and data modes of a stream-oriented API (typical of a simple serial interface). Unfortunately, TI did a very poor job of documenting the CC3000&#8242;s command protocol. There&#8217;s some low-level documentation on their <a href="http://www.ti.com/cc3000wiki">CC3000 Wiki</a>, but details about command and response data structures is missing completely. I&#8217;ve had to wade through their &#8220;host driver&#8221; code to understand the protocol. In that process, I also learned that what TI posted to the Wiki is not always correct (a common Wiki phenomenon). Among the revelations, TI says the SPI interface uses a particular style of clock/data synchronization (<a href="http://processors.wiki.ti.com/index.php/CC3000_Release_1.10_Host_Programming_Guide#Protocol_Description">CPHA=0, CPOL=0</a>, but the next sentence, the datasheet and<a href="http://e2e.ti.com/support/low_power_rf/f/851/t/186811.aspx"> this forum post</a> describe a CPHA=1 configuration.</p>
<p>Eventually, I got my own CC3000 driver code working, and was able to communicate with the CC3000 at a basic level. I saww that the firmware on my module was quite old (version 1.7, while the current version is 1.10.1). TI provides sample code for updating the firmware, but it only works for their MSP430 and Stellaris microcontrollers, Windows, and proprietary/closed development tools. That won&#8217;t work for me, so I ported the patch update code. This was rather scary, as I was sure I&#8217;d have a bug in my code and would brick my CC3000 module. At a couple of points, it looked like I had. But it turns out their bootloader and update process is robust, and I was able to back out my applied (and messed-up) patches and re-write them correctly.</p>
<div id="attachment_972" class="wp-caption aligncenter" style="width: 523px"><a href="http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/arm-gdb-tui/" rel="attachment wp-att-972"><img src="http://www.sharebrained.com/wp-content/2013/02/arm-gdb-tui.png" alt="" title="Rocking ARM GDB --tui!" width="513" height="306" class="size-full wp-image-972" /></a><p class="wp-caption-text">I used to debug in a fancy IDE, but these days I like GDB &#8211;tui.</p></div>
<p>Commands issued to the CC3000 over SPI are wrapped in an &#8220;HCI&#8221; structure, which looks a lot like your ordinary <a href="http://en.wikipedia.org/wiki/Remote_procedure_call">RPC (remote procedure call)</a>. On top of the HCI layer, they&#8217;ve implemented an API modeled after <a href="http://en.wikipedia.org/wiki/Berkeley_sockets">BSD sockets</a>. But it seems like their sockets implementation doesn&#8217;t behave quite the same as it does on a PC. For instance, when I&#8217;m connected to sharebrained.com via HTTP, my PC sockets test program disconnects after the HTTP body content is downloaded. On the CC3000 side, I receive no indication that the server has disconnected &#8212; the socket is not signaled as closed, and I see no indication via select(). So I&#8217;ll have to parse the HTTP response header (and I should anyway) to figure out when I&#8217;m done downloading. Not sure what I should do if no Content-Length is provided by the server. Time to break out the HTTP RFC&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2013/02/21/wifi-module-for-10-dollars/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Chronulator on List of Engineer Gift Ideas</title>
		<link>http://www.sharebrained.com/2012/12/06/engineer-gift-ideas/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=engineer-gift-ideas</link>
		<comments>http://www.sharebrained.com/2012/12/06/engineer-gift-ideas/#comments</comments>
		<pubDate>Thu, 06 Dec 2012 18:04:15 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[chronulator]]></category>
		<category><![CDATA[gift idea]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=954</guid>
		<description><![CDATA[The Chronulator is a "good gift" for engineers on National Instruments' News in Real Time blog! <a href="http://www.sharebrained.com/2012/12/06/engineer-gift-ideas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Chronulator was featured prominently in a National Instruments blog post, &#8220;<a href="https://decibel.ni.com/content/groups/ni-news-in-real-time/blog/2012/12/03/yes-virginia-you-can-buy-an-engineer-a-good-gift">Yes, Virginia: You CAN Buy an Engineer a Good Gift</a>&#8220;:</p>
<blockquote><p>The world’s fastest LabVIEW programmer Darren Nattinger suggested a throwback clock called The Chronulator. “I have one on my desk at home and I&#8217;m a big fan of it,” Nattinger said. “It uses a pre-programmed TI microcontroller and two analog ammeters to represent hours and minutes. It comes pre-built or as a solderable kit that you can put together. The source code is even available if you want to tinker with it.”</p></blockquote>
<p>This explains the sudden up-tick in Chronulator orders from people with geeky e-mail addresses. Thanks to everybody who ordered a kit &#8212; I hope the intended recipient enjoys it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2012/12/06/engineer-gift-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Church of Robotron at ToorCamp 2012</title>
		<link>http://www.sharebrained.com/2012/09/21/mcor-toorcamp-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mcor-toorcamp-2012</link>
		<comments>http://www.sharebrained.com/2012/09/21/mcor-toorcamp-2012/#comments</comments>
		<pubDate>Fri, 21 Sep 2012 18:06:53 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[dorkbot]]></category>
		<category><![CDATA[laser]]></category>
		<category><![CDATA[light controller]]></category>
		<category><![CDATA[mcor]]></category>
		<category><![CDATA[readerboard]]></category>
		<category><![CDATA[robotron]]></category>
		<category><![CDATA[teensy]]></category>
		<category><![CDATA[toorcamp]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=936</guid>
		<description><![CDATA[Mobile Church of Robotron at ToorCamp 2012! <a href="http://www.sharebrained.com/2012/09/21/mcor-toorcamp-2012/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A group of Dorkbot PDX Dorks got together on a project to identify the Mutant Savior that will deliver the last human family from the brutal tyranny of the Robotrons.</p>
<div id="attachment_937" class="wp-caption alignright" style="width: 339px"><a href="http://www.sharebrained.com/wp-content/2012/09/robotron-flyer.jpg"><img src="http://www.sharebrained.com/wp-content/2012/09/robotron-flyer.jpg" alt="" title="Robotron: 2084 Flyer" width="329" height="480" class="size-full wp-image-937" /></a><p class="wp-caption-text">Robotron: 2084 Flyer</p></div>
<p>What? You don&#8217;t know what Robotrons are? Let me clue you in. Robotron: 2084 is a video game from 1982, when video games were primarily an arcade experience. Yes, you had to leave your house and pay money to play video games!</p>
<p>Robotron is quite an amazing game. It seems simple by every measure, and yet it&#8217;s very hard to master. I think that&#8217;s why my group of friends love it so much.</p>
<p>Anyhow, a bunch of us planned to attend <a href="http://toorcamp.org/">ToorCamp</a> 2012, a technology/geek/hacker camp in Washington State. An idea was hatched to create an exhibit at ToorCamp, based on the story behind the game. So the Mobile Church of Robotron was born, in attempt to identify the Mutant Savior, the only being capable of saving humanity from the Robotrons, a breed of &#8220;perfect&#8221; robots created by humans.</p>
<p>Many <a href="https://www.pjrc.com/teensy/">Teensys</a> and <a href="http://arduino.cc/">Arduinos</a> and lasers and fog machines were pressed into service building an altar at which humans would be tested. It was brilliant:</p>
<p><a href="http://www.sharebrained.com/wp-content/2012/09/church-scene.jpg"><img src="http://www.sharebrained.com/wp-content/2012/09/church-scene-560x315.jpg" alt="" title="Mobile Church of Robotron" width="560" height="315" class="aligncenter size-medium wp-image-940" /></a></p>
<p><iframe src="http://player.vimeo.com/video/49144596" width="500" height="319" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen class="aligncenter"></iframe></p>
<p>Sadly, we did not identify the Mutant Savior at ToorCamp. But the search continues! Join the cause by reading the <a href="http://churchofrobotron.com/">church literature</a>, visiting us at a <a href="http://dorkbotpdx.org/meetings/">Dorkbot PDX meeting</a>, or contributing to the ball of code that is the <a href="https://github.com/breedx2/mcor/">MCOR source code repository</a>.</p>
<p>My contributions consisted of the LED sign which showed high scores. I had to reverse-engineer the sign, as the company that manufactured the sign refused to release documentation for the display&#8217;s protocol. So I replaced the CPU board with an Arduino. I&#8217;ll write up a bit about the process and publish the circuit board design and software soon.</p>
<p>I also built up a simple light controller for the totem pole erected outside the church. It&#8217;s based on an earlier controller that I designed for the Make: TV Dispenser Brian and I did for Maker Faire 2009.</p>
<p><a href="http://www.sharebrained.com/wp-content/2012/09/church-totem.jpg"><img src="http://www.sharebrained.com/wp-content/2012/09/church-totem.jpg" alt="" title="Church of Robotron Totem Pole" width="384" height="512" class="aligncenter size-full wp-image-944" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2012/09/21/mcor-toorcamp-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dorkbot PDX at Portland Mini Maker Faire</title>
		<link>http://www.sharebrained.com/2012/09/18/dorkbot-pdx-at-portland-mini-maker-faire/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dorkbot-pdx-at-portland-mini-maker-faire</link>
		<comments>http://www.sharebrained.com/2012/09/18/dorkbot-pdx-at-portland-mini-maker-faire/#comments</comments>
		<pubDate>Tue, 18 Sep 2012 16:34:33 +0000</pubDate>
		<dc:creator>jboone</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[dorkbot]]></category>
		<category><![CDATA[maker faire]]></category>
		<category><![CDATA[omsi]]></category>

		<guid isPermaLink="false">http://www.sharebrained.com/?p=932</guid>
		<description><![CDATA[Dorkbot PDX was well-represented (five tents!) at the Portland Mini Maker Faire. <a href="http://www.sharebrained.com/2012/09/18/dorkbot-pdx-at-portland-mini-maker-faire/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last weekend, I joined my <a href="http://www.dorkbotpdx.org/">Dorkbot PDX</a> compatriots in exhibiting our projects at the <a href="http://www.omsi.edu/maker-faire-pdx">Portland Mini Maker Faire</a>. It&#8217;s no surprise that half the photos in <a href="http://blog.makezine.com/2012/09/16/portlands-first-maker-faire/">this photo gallery</a> are of Dork projects! Where else can you find people who are into beekeeping, rocketry, high-altitude ballooning, aerial photography, robotics, and geometrical metalworking? If you haven&#8217;t attended a local Dorkbot meeting, <a href="http://www.dorkbot.org/">find one near you</a> and GO!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharebrained.com/2012/09/18/dorkbot-pdx-at-portland-mini-maker-faire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
