<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Keyglove</title>
	
	<link>http://www.keyglove.net</link>
	<description />
	<lastBuildDate>Thu, 13 Jun 2013 14:58:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/keyglove" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="keyglove" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Complex Bluetooth HID input with iWRAP and the Bluegiga WT12</title>
		<link>http://www.keyglove.net/2013/05/30/complex-bluetooth-hid-with-iwrap-and-the-bluegiga-wt12/</link>
		<comments>http://www.keyglove.net/2013/05/30/complex-bluetooth-hid-with-iwrap-and-the-bluegiga-wt12/#comments</comments>
		<pubDate>Fri, 31 May 2013 01:33:58 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[hid]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[mouse]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1365</guid>
		<description><![CDATA[Thanks to Bluegiga's workhorse of a class 2 Bluetooth module and the latest iWRAP5 firmware with custom HID descriptor support, I have now been able to achieve the wireless capabilities I always hoped the Keyglove would have. Keyboard, mouse with scrolling support, consumer page reports, and raw HID packets for arbitrary data transmission.]]></description>
				<content:encoded><![CDATA[<p>Thanks to Bluegiga&#8217;s workhorse of a class 2 Bluetooth module and the latest iWRAP5 firmware with custom HID descriptor support, I have now been able to achieve the wireless capabilities I always hoped the Keyglove would have. Keyboard, mouse <em>with scrolling support</em>, consumer page reports, and raw HID packets for arbitrary data transmission. It isn&#8217;t fully integrated into the Keyglove code yet, and I&#8217;ve only tested it with manual control so far, but the firmware setup is solid. It&#8217;s now just a matter of translating the manual control I&#8217;ve already done into my codebase.<br />
<span id="more-1365"></span></p>
<p>The enabling factor here compared to the last time I tried this (quite some time ago) is the addition of custom descriptor support in iWRAP5. I don&#8217;t know of any other module which allows the degree of simple customizability in this area that the WT12 does. It was the best module I saw two years ago, and the new features are icing on the cake. (Yes, I have been working at Bluegiga since last October, but bear in mind I was singing this module&#8217;s praises long before that started.)</p>
<p>So how does this configuration actually work? There are three important pieces involved:</p>
<ol>
<li>Building the HID descriptor</li>
<li>Configuring iWRAP</li>
<li>Sending HID report packets</li>
</ol>
<p>Naturally, I will explain each in order.</p>
<h3>Building the HID descriptor</h3>
<p>To be honest, this is the part I am least confident about. I have learned a lot about HID descriptors, but only enough to be dangerous instead of simply clueless. In short, they are sent from a device to a host during the connection establishment phase so that the host will know what kind of data to expect from the device, how it will be formatted, and what it should do with it. A HID descriptor is built using a predefined binary &#8220;language&#8221; of sorts; data bytes either denote a field or setting, or else are the byte(s) contained within the previously denoted field or setting. There are many aspects to these definitions, and I don&#8217;t fully understand them all yet. It will be much better if I point you to the resources that were most helpful for me:</p>
<ul>
<li><a href="http://www.instructables.com/id/USB-Wii-Classic-Controller/step13/Bonus-Keyboard-and-Mouse/">Step 13 of Frank Zhao&#8217;s USB Wii Classic Controller Instructable</a></li>
<li><a href="http://www.frank-zhao.com/cache/hid_tutorial_1.php">Frank Zhao&#8217;s USnooBie HID Report tutorial</a> (way to go, Frank!)</li>
<li><a href="http://www.usb.org/developers/devclass_docs/HID1_11.pdf">The USB HID device class specification (PDF)</a></li>
<li><a href="http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf">The USB HID usage tables specification (PDF)</a></li>
<li><a href="http://www.usb.org/developers/hidpage#HID Descriptor Tool">The USB HID Descriptor Tool</a></li>
<li><a href="http://www.usblyzer.com/">USBlyzer</a> for complete descriptor analysis of an existing USB device</li>
<li>The raw HID descriptor structs found in PJRC&#8217;s <a href="http://www.pjrc.com/teensy/teensyduino.html">Teensyduino</a> source</li>
</ul>
<p>Actually, the first and last links ended up being the most practically useful to me. The others are good for cross-referencing things or getting into a detailed understanding. It&#8217;s a great list to get started with if you&#8217;re looking for HID development resources. Also, USBlyzer can be amazing if you are trying to mimic the behavior of an existing wired USB device, since it can show you both the descriptor structure as well as the actual HID report traffic.</p>
<p>But what&#8217;s all this about USB? Wasn&#8217;t the whole point of this to be all wireless and Bluetoothy and stuff? Well, it turns out that the important bits of device-specific USB HID descriptors pretty much apply directly to Bluetooth HID, because as best as I can tell, Bluetooth HID is basically USB HID wrapped in a wireless transport layer. It isn&#8217;t <em>exactly</em> the same, of course, but the most important pieces—namely, the HID descriptor and corresponding HID reports—match.</p>
<p>Now, what about Bluegiga&#8217;s HID documentation? There is a HID application note for iWRAP which is quite good if you are interested in single-function devices, or if you know what you are doing with descriptors. But if you&#8217;re only good at following directions <em>and</em> you want a combo device, it&#8217;s less obvious. <em>(I will be fixing this shortly, because now I can!)</em> There are example descriptors supplied for a standard keyboard, standard mouse (X/Y + 3 buttons), consumer page control (e.g. calculator and music controls), and a gamepad. But what if you want a keyboard/mouse/gamepad device all in one?</p>
<p>It turns out that this is really not difficult at all. There are two basic rules you have to follow:</p>
<ol>
<li>Take each individual descriptor and mash them all together into one big long one.</li>
<li>Make sure each report structure definition includes a &#8220;Report ID&#8221; byte (0&#215;85) and unique value (0&#215;01 or higher).</li>
</ol>
<p>The first one is easy. The second one is not so easy if you don&#8217;t know where the Report ID byte should go. Based on my tests, it needs to go <em>after</em> the innermost &#8220;Collection&#8221; start field (0xA1 0x<em>nn</em>) somewhere. I don&#8217;t know what the rule is exactly, but I put them (when they weren&#8217;t already there) immediately after this &#8220;Collection&#8221; start field. Each report needs its own unique ID so that the host device knows which kind of report you&#8217;re sending, whenever you send one. Pretty straightforward.</p>
<p>Here is the actual descriptor I put together for my successful test last night, in C struct form:</p>
<pre>static const uint8_t hid_descriptor_combined[] = {

    // KEYBOARD

    /****/ 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
    /****/ 0x09, 0x06, /* USAGE (Keyboard) */
    /****/ 0xa1, 0x01, /* COLLECTION (Application) */
    /******/ 0x05, 0x07, /* USAGE_PAGE (Keyboard) */
    /******/ 0x85, 0x01,   /* REPORT_ID (1) */
    /* 1 byte Modifier: Ctrl, Shift and other modifier keys, 8 in total */
    /******/ 0x19, 0xe0, /* USAGE_MINIMUM (kbd LeftControl) */
    /******/ 0x29, 0xe7, /* USAGE_MAXIMUM (kbd Right GUI) */
    /******/ 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
    /******/ 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
    /******/ 0x75, 0x01, /* REPORT_SIZE (1) */
    /******/ 0x95, 0x08, /* REPORT_COUNT (8) */
    /******/ 0x81, 0x02, /* INPUT (Data,Var,Abs) */
    /* 1 Reserved byte */
    /******/ 0x95, 0x01,  /* REPORT_COUNT (1) */
    /******/ 0x75, 0x08, /* REPORT_SIZE (8) */
    /******/ 0x81, 0x01, /* INPUT (Cnst,Ary,Abs) */
    /* LEDs for num lock etc */
    /******/ 0x95, 0x05, /* REPORT_COUNT (5) */
    /******/ 0x75, 0x01, /* REPORT_SIZE (1) */
    /******/ 0x05, 0x08, /* USAGE_PAGE (LEDs) */
    /******/ 0x85, 0x01, /* REPORT_ID (1) */
    /******/ 0x19, 0x01, /* USAGE_MINIMUM (Num Lock) */
    /******/ 0x29, 0x05, /* USAGE_MAXIMUM (Kana) */
    /******/ 0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
    /* Reserved 3 bits */
    /******/ 0x95, 0x01, /* REPORT_COUNT (1) */
    /******/ 0x75, 0x03, /* REPORT_SIZE (3) */
    /******/ 0x91, 0x03, /* OUTPUT (Cnst,Var,Abs) */
    /* Slots for 6 keys that can be pressed down at the same time */
    /******/ 0x95, 0x06, /* REPORT_COUNT (6) */
    /******/ 0x75, 0x08, /* REPORT_SIZE (8) */
    /******/ 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
    /******/ 0x25, 0x65, /* LOGICAL_MAXIMUM (101) */
    /******/ 0x05, 0x07, /* USAGE_PAGE (Keyboard) */
    /******/ 0x19, 0x00, /* USAGE_MINIMUM (Reserved (no event indicated)) */
    /******/ 0x29, 0x65, /* USAGE_MAXIMUM (Keyboard Application) */
    /******/ 0x81, 0x00, /* INPUT (Data,Ary,Abs) */
    /****/ 0xc0, /* END_COLLECTION */

    // CONSUMER PAGE

    /****/ 0x05, 0x0c, /* USAGE_PAGE (Consumer) */
    /****/ 0x09, 0x01, /* USAGE (Consumer Control) */
    /****/ 0xa1, 0x01, /* COLLECTION (Application) */
    /******/ 0x85, 0x02, /* Report ID 2 */
    /******/ 0x05, 0x0c, /* USAGE_PAGE (Consumer) */
    /* 8 media player related keys */
    /******/ 0x15, 0x00, /* Logical Min 0 */
    /******/ 0x25, 0x01, /* Logical Max 1 */
    /******/ 0x09, 0xe9, /* Usage (8-bit), Volume Increment */
    /******/ 0x09, 0xea, /* Usage (8-bit), Volume Decrement */
    /******/ 0x09, 0xe2, /* Usage (8-bit), Mute */
    /******/ 0x09, 0xcd, /* Usage (8-bit), Play/Pause */
    /******/ 0x19, 0xb5, /* Usage Min (Scan Next Track, Scan Previous Track, Stop, Eject) */
    /******/ 0x29, 0xb8, /* Usage Max */
    /******/ 0x75, 0x01, /* Report Size */
    /******/ 0x95, 0x08, /* Report Count */
    /******/ 0x81, 0x02, /* Input type 2 */
    /* 8 application control keys */
    /******/ 0x0a, 0x8a, 0x01,/* Usage (16-bit), LSB first, e.g. this is 0x018a Email Reader */
    /******/ 0x0a, 0x21, 0x02,/* Usage (16-bit), Generic GUI Application Control Search */
    /******/ 0x0a, 0x2a, 0x02,/* Usage (16-bit), Application Control Bookmarks */
    /******/ 0x1a, 0x23, 0x02,/* Usage Min (16-bit), AC Home, Back, Forward, Stop, Refresh */
    /******/ 0x2a, 0x27, 0x02,/* Usage Max (16-bit) */
    /******/ 0x75, 0x01, /* Report Size */
    /******/ 0x95, 0x08, /* Report Count */
    /******/ 0x81, 0x02, /* Input type 2 */
    /* Application launch keys + record &amp; rewind */
    /******/ 0x0a, 0x83, 0x01,/* Usage (16-bit), Application Launch Generic Consumer Control */
    /******/ 0x0a, 0x96, 0x01,/* Usage (16-bit), AL Internet Browser */
    /******/ 0x0a, 0x92, 0x01,/* Usage (16-bit), AL Calculator */
    /******/ 0x0a, 0x9e, 0x01,/* Usage (16-bit), AL Terminal Lock / Screensaver */
    /******/ 0x0a, 0x94, 0x01,/* Usage (16-bit), AL Local Machine Browser */
    /******/ 0x0a, 0x06, 0x02,/* Usage (16-bit), AC Minimize */
    /******/ 0x09, 0xb2, /* Usage (8-bit), Record */
    /******/ 0x09, 0xb4, /* Usage (8-bit), Rewind */
    /******/ 0x75, 0x01, /* Report Size */
    /******/ 0x95, 0x08, /* Report Count */
    /******/ 0x81, 0x02, /* Input type 2 */
    /******/ 0xc0,      /* End Collection */

    // MOUSE

    0x05, 0x01,       // USAGE_PAGE (Generic Desktop)
    0x09, 0x02,       // USAGE (Mouse)
    0xa1, 0x01,       // COLLECTION (Application)
    0x09, 0x01,       //   USAGE (Pointer)
    0xa1, 0x00,       //   COLLECTION (Physical)
    0x85, 0x03,       //     REPORT_ID (3)
    0x05, 0x09,       //     USAGE_PAGE (Button)
    0x19, 0x01,       //     USAGE_MINIMUM (Button 1)
    0x29, 0x03,       //     USAGE_MAXIMUM (Button 3)
    0x15, 0x00,       //     LOGICAL_MINIMUM (0)
    0x25, 0x01,       //     LOGICAL_MAXIMUM (1)
    0x95, 0x03,       //     REPORT_COUNT (3)
    0x75, 0x01,       //     REPORT_SIZE (1)
    0x81, 0x02,       //     INPUT (Data,Var,Abs)
    0x95, 0x01,       //     REPORT_COUNT (1)
    0x75, 0x05,       //     REPORT_SIZE (5)
    0x81, 0x03,       //     INPUT (Cnst,Var,Abs)
    0x05, 0x01,       //     USAGE_PAGE (Generic Desktop)
    0x09, 0x30,       //     USAGE (X)
    0x09, 0x31,       //     USAGE (Y)
    0x09, 0x38,       //     USAGE (Wheel)
    0x15, 0x81,       //     LOGICAL_MINIMUM (-127)
    0x25, 0x7f,       //     LOGICAL_MAXIMUM (127)
    0x75, 0x08,       //     REPORT_SIZE (8)
    0x95, 0x03,       //     REPORT_COUNT (3)
    0x81, 0x06,       //     INPUT (Data,Var,Rel)
    0x05, 0x0c,       //     USAGE_PAGE (Consumer Devices)
    0x0a, 0x38, 0x02, //     USAGE (Undefined)
    0x95, 0x01,       //     REPORT_COUNT (1)
    0x81, 0x06,       //     INPUT (Data,Var,Rel)
    0xc0,             //   END_COLLECTION
    0xc0,              // END_COLLECTION

    // RAW 16-BYTE I/O

    0x06, 0xAB, 0xFF,   // Usage Page (Vendor-Defined 172)
    0x0A, 0x00, 0x02,   // Usage (Vendor-Defined 512)
    0xA1, 0x01,         // Collection (Application)
    0x85, 0x04,         /* REPORT_ID (4) */
    0x75, 0x08,         // Report Size (8)
    0x15, 0x00,         // Logical Minimum (0)
    0x26, 0xFF, 0x00,   // Logical Maximum (255)
    0x95, 0x10,         // Report Count (16)
    0x09, 0x01,         // Usage (Vendor-Defined 1)
    0x81, 0x02,         // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)
    0x95, 0x10,         // Report Count (16)
    0x09, 0x02,         // Usage (Vendor-Defined 2)
    0x91, 0x02,         // Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)
    0xc0,               // End Collection
};</pre>
<p>Pardon the mix of comment formatting. I pulled these together from multiple sources and built one of them by hand. The structure of this descriptor is that the standard keyboard report has ID 1, consumer page report has ID 2, mouse report has ID 3, and raw generic 16-byte data packet has ID 4.</p>
<p>However, the above isn&#8217;t directly applicable to iWRAP configuration on the WT12 module, since iWRAP doesn&#8217;t use C structs as settings. This leads us to&#8230;</p>
<h3>Configuring iWRAP</h3>
<p>Luckily for all of us, the factory default iWRAP5 firmware—currently v5.0.1 build 620—supports all the HID customization we need. (It is also freely user-upgradable if you have or want a different build for whatever reason.) The default settings enable only the serial port profile (SPP), so we have to turn on the HID profile specifically, and write our descriptor. The maximum descriptor length is 255 bytes at the moment. For simplicity, here&#8217;s the full set of relevant initialization commands that I&#8217;m sending for the Keyglove&#8217;s Bluetooth module:</p>
<pre>SET BT NAME Keyglove
SET BT CLASS 00540
SET BT IDENT USB:1d50 6025 1.0.0 Keyglove Input Device
SET BT SSP 3 0
SET CONTROL CD 80 2 20
SET CONTROL ESCAPE - 40 1
SET PROFILE HID d 40 100 0 en 0409 Keyglove Input Device
HID SET F2 05010906A1010507850119E029E715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100C0050C0901A1018502050C1500250109E909EA09E209CD19B529B87501950881020A8A010A21020A2A021A23022A27027501950881020A83010A96010A92010A9E010A94010A060209B209B4750195088102C005010902A1010901A10085030509190129031500250195037501810295017505810305010930093109381581257F750895038106050C0A380295018106C0C006ABFF0A0002A10185047508150026FF00951009018102951009029102C0</pre>
<p>That ridiculously long &#8220;HID SET&#8221; line at the end is the descriptor itself. The lone preceding &#8220;F2&#8243; value is the length (in hex) of the whole thing, which is 242 bytes. I&#8217;m right at the edge of the size limit with this one.</p>
<p>Here&#8217;s a quick breakdown of these settings (see the iWRAP5 User Guide from Bluegiga for more detail):</p>
<ul>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET BT NAME Keyglove</pre>
<p>- Sets the Bluetooth device friendly name</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET BT CLASS 00540</pre>
<p>- Sets the device class to &#8220;keyboard&#8221; (<strong>important for iOS compatibility</strong>)</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET BT IDENT USB:1d50 6025 1.0.0 Keyglove Input Device</pre>
<p>- Sets the VID/PID, version, and self-identifying description</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET BT SSP 3 0</pre>
<p>- Enables PIN-less &#8220;just works&#8221; secure simple pairing</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET CONTROL CD 80 2 20</pre>
<p>- Enables GPIO output signals for active link and DATA mode status</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET CONTROL ESCAPE - 40 1</pre>
<p>- Enable GPIO input control for exiting DATA mode</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">SET PROFILE HID d 40 100 0 en 0409 Keyglove Input Device</pre>
<p>- Sets the HID options to be a keyboard class device, English layout, no localization, version 1.0.0</li>
<li style="margin-bottom: 1em;">
<pre style="margin-bottom: 0.2em;">HID SET F2 ...</pre>
<p>- Explained above. Sets the actual HID descriptor.</li>
</ul>
<p>Not all of these are strictly necessary for the HID functionality I&#8217;m going for (e.g. the &#8220;SET CONTROL &#8230;&#8221; commands and BT NAME), but the rest are. Note also that all of these persist through power cycles, since all of them are stored in non-volatile memory. Once these settings are applied the first time, you must power-cycle the module or issue a &#8220;RESET&#8221; command to make them take effect—particularly the newly enabled HID profile and HID descriptor.</p>
<p>Now we&#8217;re ready to actually send some data.</p>
<h3>Sending HID report packets</h3>
<p>iWRAP uses a specific encapsulation format for sending raw HID packets. It will actually let you send basic ASCII keyboard characters as plain bytes over UART—so the byte &#8216;a&#8217; (0&#215;61) sends the keyboard HID reports for pressing and releasing the &#8216;a&#8217; key—but only if you have the standard keyboard descriptor included at the beginning of your full HID descriptor. As it happens, we do. But full control only comes through the use of raw HID packets, so that&#8217;s what we&#8217;ll be using here. The raw HID format, as described in the iWRAP HID app note, is always of this form:</p>
<pre>0x9F [length] [data ... ... ...]</pre>
<p>Where 0x9F is the start-of-frame byte, [length] is how many data bytes follow, and [data ...] is the actual data itself. So, for a 6-byte packet example, it might be formatted like this:</p>
<pre>0x9F 0x06 0xAA 0xBB 0xCC 0xDD 0xEE 0xFF</pre>
<p>The above packet is invalid given our descriptors, but it illustrates the point. Remember that we have four unique reports in our combo descriptor above, so there are four possible kinds of raw reports we might send:</p>
<ol>
<li>Keyboard
<pre>0x9F 0x0A 0xA1 <strong style="color: #F00;">0x01</strong> [modifier] 0x00 [key1] [key2] [key3] [key4] [key5] [key6]</pre>
</li>
<li>Consumer page
<pre>0x9F 0x05 0xA1 <strong style="color: #F00;">0x02</strong> [field1] [field2] [field3]</pre>
</li>
<li>Mouse
<pre>0x9F 0x07 0xA1 <strong style="color: #F00;">0x03</strong> [buttons] [x-move] [y-move] [v-scroll] [h-scroll]</pre>
</li>
<li>Raw
<pre>0x9F 0x12 0xA1 <strong style="color: #F00;">0x04</strong> [data1 ... data16]</pre>
</li>
</ol>
<p>Note the Report ID byte in <strong style="color: #F00;">red</strong>. For testing purposes, I like using <a href="http://realterm.sourceforge.net/index.html#downloads_Download">Realterm</a> because (1) it&#8217;s free and (2) it makes sending or displaying binary data in hex format easier than anything else I&#8217;ve seen. The UI is definitely engineer-ish, but it doesn&#8217;t take too much getting used to, and it has some features that are very hard to do without in cases like these. Realterm has a &#8220;Send&#8221; tab where you can paste bytes in hex notation (either 0xAA or $AA) and then send them as binary data, which is excellent here.</p>
<p>One important thing to point out here is that for many operations that we tend to think of as a single action, like a keypress or mouse click, there are actually two things going on. One is the press and the other is the release. It is critical that you keep this in mind when sending raw reports. Pressing the &#8216;a&#8217; key is actually sending one report with the key down and another with no keys down. Here are some examples of each kind of descriptor:</p>
<h4>Press and release the &#8216;a&#8217; key</h4>
<pre style="margin-bottom: 0.2em;">0x9F 0x0A 0xA1 0x01 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x00</pre>
<pre>0x9F 0x0A 0xA1 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00</pre>
<h4>Press and release the calculator button</h4>
<pre style="margin-bottom: 0.2em;">0x9F 0x05 0xA1 0x02 0x00 0x00 0x04</pre>
<pre>0x9F 0x05 0xA1 0x02 0x00 0x00 0x00</pre>
<h4>Press and release the left mouse button</h4>
<pre style="margin-bottom: 0.2em;">0x9F 0x07 0xA1 0x03 0x01 0x00 0x00 0x00 0x00</pre>
<pre>0x9F 0x07 0xA1 0x03 0x00 0x00 0x00 0x00 0x00</pre>
<h4>Send 16 bytes of raw data</h4>
<pre style="margin-bottom: 0.2em;">0x9F 0x12 0xA1 0x04 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xAA 0xBB 0xCC 0xDD 0xEE 0xFF</pre>
<p>(This is a single action and doesn&#8217;t require a &#8220;release&#8221; report)</p>
<p>This successful implementation of complex Bluetooth HID is an excellent next step in the Keyglove development. While the raw HID (as far as I know) is not accessible on iOS devices, this same combo descriptor and iWRAP configuration allows you to connect to a PC, Mac, Linux machine, iPhone, and Android phone—and, I assume and very much hope, Google Glass. We shall see in approximately 10 days.</p>
<p>Until then, have fun with your own Bluetooth HID projects, if you are so inclined!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2013/05/30/complex-bluetooth-hid-with-iwrap-and-the-bluegiga-wt12/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Diving back in, and Google Glass plans</title>
		<link>http://www.keyglove.net/2013/05/04/diving-back-in-and-google-glass-plans/</link>
		<comments>http://www.keyglove.net/2013/05/04/diving-back-in-and-google-glass-plans/#comments</comments>
		<pubDate>Sun, 05 May 2013 03:35:44 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1356</guid>
		<description><![CDATA[The last seven months have been somewhat of an unplanned hiatus from the Keyglove project. Now, I am absolutely determined to get back into working on it, for a few reasons.]]></description>
				<content:encoded><![CDATA[<p>The last seven months have been somewhat of an unplanned hiatus from the Keyglove project. As I mentioned in <a href="http://www.kickstarter.com/projects/jrowberg/keyglove-wearable-input-device/posts/340775">my last Kickstarter project update</a> as well as a bit later in <a href="http://www.sectorfej.net/2013/01/01/happy-new-year-from-the-new-us-field-application-engineer-at-bluegiga/">a post on my personal blog</a>, my position at Bluegiga has been taking virtually all of my time. There is a lot more travel, and some odd hours due to the global nature of the business and the kind of support I need to do. This has been getting better over time though—the odd hours part, anyway—and I am absolutely determined to get back into working on the project, for a few reasons.<br />
<span id="more-1356"></span></p>
<p>For one thing, I have now passed the two-year anniversary of the successful Kickstarter campaign. It was one week ago today, in fact: April 27. That is a <em>tremendously</em> long time to wait, for all those of you who backed the project. I am continually encouraged by the ongoing support, and conversely by the conspicuous lack of impatience displayed despite the long, drawn-out development process and the painfully long silences at times (like over the last many months). I want to work on this project, and I want to do it <em>now</em>. This by itself is motivating.</p>
<p>For another thing, although I haven&#8217;t had much time to <em>work</em> on the Keyglove, I have still found myself thinking about it quite often and at times doing what could be accurately called brainstorming. Some of the ideas I&#8217;ve had should prove to be fruitful once I immerse myself in development again. A corresponding observation to this point is that I think it will be beneficial for me to begin again with the codebase and designs I already have, but with a relatively fresh viewpoint. It will be easy for me to objectively evaluate the systems I have already built and look for any areas which may benefit from certain changes or a re-imagined approach. This kind of analysis is easier to do when you haven&#8217;t been neck deep in the project for a while.</p>
<p>Third, there has been quite a bit of relevant innovation in the areas of wearable computing, wireless connectivity, battery technology, and low-power programmable microcontroller systems. Might it be worthwhile to incorporate an Arduino compatible ARM processor instead of the AT90USB MCU I have? Possibly. Bluetooth Low Energy for wireless comms? Very likely, at least as an option. Flexible PCBs? Maybe. New, tiny motion sensor? Sounds great. Bundling everything into a single FPGA? It could be done. The bottom line here is that six or seven months on the embedded system design timescale is significant. There is a lot that has happened in the world since then.</p>
<p>Perhaps the most personally exciting reason for me though is this:</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2013/05/projectglass_sectorfej_tweet.png" rel="wp-prettyPhoto[g1356]"><img class="aligncenter size-medium wp-image-1357" alt="projectglass_sectorfej_tweet" src="http://www.keyglove.net/wp-content/uploads/2013/05/projectglass_sectorfej_tweet-300x187.png" width="300" height="187" /></a></p>
<p>I managed to snag a slot on the new Google Glass Explorers group as part of the <a href="https://twitter.com/search?q=%23ifihadglass">#ifihadglass</a> contest that Google put on back in February. I am definitely more excited about this than is healthy for someone as far down the list of early adopters as I am (though I am still thankful that I&#8217;m on the list in the first place). My <a href="https://twitter.com/SectorFej/status/304267259772276736">entry tweet</a> was about combining it with the Keyglove, and <a href="https://twitter.com/projectglass/status/317531425035386880">their reply</a> came a little over a month later. I was (and am) ecstatic.</p>
<p>As it happens, I actually got to try a Glass device back towards the end of January of this year, while having dinner in San Francisco with a friend from college who is now way high up on the Glass development team. It was a pretty short demo, but I was completely enamored. Truth be told, I&#8217;d actually had a dream the night before about what it might be like, in subconscious anticipation of that eventuality. I truly can hardly wait for until my turn comes to get a development unit. This is exactly the platform for which I originally created the Keyglove. I don&#8217;t know when I will get mine, but I want the Keyglove to be ready to take full advantage of the opportunity.</p>
<p>In my opinion (and <a href="https://plus.google.com/+Scobleizer/posts/ZLV9GdmkRzS">others&#8217;</a>), Google Glass has tremendous potential. Augmented reality and instant contextual information has a value that we can&#8217;t accurately quantify yet. We don&#8217;t have enough data to predict with. Glass will allow innovative people to expand the range of possibilities, to give us ideas about things we will find invaluable which today we can&#8217;t even imagine since we don&#8217;t have a mental framework to put them on. I want the Keyglove to be right there along side this discovery process, solving the input challenge where Glass so (comparatively) eloquently solves the output/display problem of wearable technology.</p>
<p>So, while I&#8217;m waiting for Glass&#8230;what&#8217;s next?</p>
<p>I need to run through the <a href="http://www.keyglove.net/roadmap/">Roadmap</a> again and freshen things up a bit. Then I need to try compiling the last code snapshot I have and see exactly where I left things at the end of September. Then, I will read through the modular code structure I have and see if there are any structural changes to make right off the bat, or if I should go straight to fixing bugs and adding or completing features.</p>
<p>Begone, distractions! I have work to do!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2013/05/04/diving-back-in-and-google-glass-plans/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VIDEO: Prototype D Autodesk Inventor COM API Demo</title>
		<link>http://www.keyglove.net/2012/07/26/video-prototype-d-autodesk-inventor-com-api-demo/</link>
		<comments>http://www.keyglove.net/2012/07/26/video-prototype-d-autodesk-inventor-com-api-demo/#comments</comments>
		<pubDate>Thu, 26 Jul 2012 17:33:58 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[autodesk]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[inventor]]></category>
		<category><![CDATA[kit]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1286</guid>
		<description><![CDATA[Keyglove #10 &#8211; Prototype D Autodesk Inventor COM API Demo from Jeff Rowberg on Vimeo. This video demonstrates Keyglove Prototype D and the Keyglove Kit v0.4 PCB (v0.5 still pending design completion) along with the alpha Keyglove Manager app integrated with Autodesk Inventor using the COM API [...]]]></description>
				<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/46414304" width="608" height="342" frameborder="0"></iframe>
<p><a href="http://vimeo.com/46414304">Keyglove #10 &#8211; Prototype D Autodesk Inventor COM API Demo</a> from <a href="http://vimeo.com/sectorfej">Jeff Rowberg</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>This video demonstrates Keyglove Prototype D and the Keyglove Kit v0.4 PCB (v0.5 still pending design completion) along with the alpha Keyglove Manager app integrated with Autodesk Inventor using the COM API for true 3D input. This is just a sample of the kind of thing that can be done with the Keyglove. And, honestly, this isn&#8217;t even a very good demo due to the early stage of development of the Manager app and the loose mounting of the older revision of the PCB on the glove.<br />
<span id="more-1286"></span></p>
<p>The sensor connections to the controller board have also been wired into per-finger female headers, which means it&#8217;s far easier to swap in a new controller board whenever I update the design. I don&#8217;t have to find each individual pin connection and put them in the right order; it&#8217;s all conveniently broken out on the PCB, and I can just plug in each header into the six main connectors (thumb, four fingers, and palm). Now I just need to get that new PCB version fabricated so I can mount the board on the glove more easily.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/07/26/video-prototype-d-autodesk-inventor-com-api-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyglove Interface Options</title>
		<link>http://www.keyglove.net/2012/06/05/keyglove-interface-options/</link>
		<comments>http://www.keyglove.net/2012/06/05/keyglove-interface-options/#comments</comments>
		<pubDate>Tue, 05 Jun 2012 04:27:15 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[hid]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1271</guid>
		<description><![CDATA[As I continue building the code to support all the necessary aspects of the configuration and control protocol for the Keyglove, I am also thinking about the various ways the protocol will be used, and how to keep everything as predictable and flexible as possible. There are both wired and wireless methods of interfacing with this device, but it turns out to be a little more complex than that.]]></description>
				<content:encoded><![CDATA[<p>As I continue building the code to support all the necessary aspects of the configuration and control protocol for the Keyglove, I am also thinking about the various ways the protocol will be used, and how to keep everything as predictable and flexible as possible. There are both wired and wireless methods of interfacing with this device, but it turns out to be a little more complex than that.<br />
<span id="more-1271"></span></p>
<p>There are two general modes of communication at the physical layer: <strong>wired</strong> and <strong>wireless</strong>. This is pretty obvious. For clarity, I am only officially supporting USB (wired) and Bluetooth (wireless) interfaces, but theoretically you can use other types of wired or wireless connections if you&#8217;d like. One very smart guy, Mike Cochrane, even hacked a <a href="http://mikenz.geek.nz/blog/keyglove/">Logitech R400 wireless module into his prototype</a>. But anyway&#8230;back to USB and Bluetooth.</p>
<p>Above this physical interface layer, there are a couple of different types of communication that occur between the Keyglove and the host being controlled:</p>
<ol>
<li style="margin-bottom: 1em;"><strong>Configuration commands sent from the host to the Keyglove</strong><br />These commands are used to define the Keyglove&#8217;s behavior, enable or disable features, change options, load and save glove-based touchset definitions, query available features, and more. Anything the host might need to know about or change inside the Keyglove is done with a configuration command.</li>
<li style="margin-bottom: 1em;"><strong>Behavior events sent from the Keyglove to the host</strong><br />Events including anything that may be triggered by an internal or user-controlled Keyglove action, such as a touch, gesture, battery notification, mode switch, etc. Anything the Keyglove might need to send to the host without the host asking first is an event.</li>
<li><strong>Direct input signals sent from the Keyglove to the host (keyboard, mouse, joystick, etc.)</strong><br />These are generated by the internal touchset definition, and sent to the host as standard Human Input Device (HID) signals according to established keyboard, mouse, and even joystick signals.</li>
</ol>
<p>I&#8217;ve been promoting #3 for quite some time now because it doesn&#8217;t require any drivers, since it enumerates on the host as a regular keyboard, mouse, and/or joystick. This mode of operation is definitely valuable and convenient, and it will continue to be supported in both wired and wireless capacity. There are some great use cases for this mode, particularly those having to do with mobile computing.</p>
<p>However, if #3 was the only method available, the potential for the Keyglove would be severely limited. First, it would be practically impossible to change its behavior without re-flashing new firmware, or implementing some complicated touch-based method of reprogramming. Second, we wouldn&#8217;t be able to automatically swap touchsets on the host when switching different applications into the foreground. You could switch manually using a custom touch, but then literally all behavior would need to be defined on the Keyglove itself, which could get complicated and might even be too restrictive, depending on hardware. Certain devices also only support Bluetooth HID and not SPP without lot of extra licensing, such as the iPhone and iPad.</p>
<p>So, I&#8217;ve also been working on the bidirectional serial protocol, which takes care of #1 and #2 above. This protocol, combined with some still-under-development OS-specific &#8220;Keyglove Manager&#8221; applications, allows for greatly extended functionality. Since the direct input mode (#3) will still be implemented and usable if desired, we end up with an optimal solution: convenience for those who prefer it, and power for those who want more control.</p>
<h3>Which Interfaces Support Which Modes?</h3>
<p>Now that we know what kinds of signals we need to send and receive, we need to know how we can actually accomplish the goal. Based on what I believe (and am totally guessing) will be normal modes of usage, combined with known limitations of each kind of interface, here is what I came up with.</p>
<p><strong>Configuration commands</strong> may be sent from the host to the Keyglove over a serial port or custom HID endpoint (not a standard keyboard/mouse/joystick). We also want to make sure that we parse any and every configuration command sent over any interface, to avoid the possibility of locking ourselves out accidentally. Therefore, configuration commands are <em>always</em> parsed from any interface that is supported in the firmware, namely:</p>
<ul>
<li>USB serial (wired)</li>
<li>USB HID (wired)</li>
<li>Bluetooth serial (wireless)</li>
<li>Bluetooth HID (wireless)</li>
</ul>
<p><strong>Behavior events</strong> may be sent from the Keyglove to the host over a serial port or custom HID endpoint (again, not a standard keyboard/mouse/joystick). Unlike configuration commands, however, we might not care to do see these on the host&mdash;particularly if we&#8217;re using direct input signals from an onboard touchset. So while these are enabled by default on any interface which is connected, they may be selectively disabled at any time. This setting persists across power cycles, since it will be stored in non-volatile memory (internal EEPROM). Supported interfaces are as follows:</p>
<ul>
<li>USB serial (wired)</li>
<li>USB HID (wired)</li>
<li>Bluetooth serial (wireless)</li>
<li>Bluetooth HID (wireless)</li>
</ul>
<p>Events are sent out sequentially in the above order (USB serial, then USB HID, then Bluetooth serial, then Bluetooth HID) for any interface that is supported <em>and</em> enabled in the firmware, and which has an active link in the case of Bluetooth. Thanks to the fantastic Bluegiga WT12&#8242;s iWRAP firmware, it is possible to have simultaneous serial (SPP) and HID links going&mdash;though support for this hasn&#8217;t been fully developed yet.</p>
<p><strong>Direct input</strong> (keyboard/mouse/joystick) may be sent out only over HID, unlike the other two. But as before, it is possible to send these out over both physical layers:</p>
<ul>
<li>USB (wired)</li>
<li>Bluetooth (wireless)</li>
</ul>
<p>Direct input is sent out sequentially in the above order (USB HID, Bluetooth HID) if each interface is supported <em>and</em>enabled in the firmware, and at least one internal touchset is defined in memory, and internal touchset usage is enabled (remember that it may be disabled in favor of OS-based custom touchsets).</p>
<h3>So What&#8217;s &#8220;Normal&#8221; Behavior?</h3>
<p>Currently, the planned default behavior out of the box is this:</p>
<ol>
<li>Parse configuration commands from any interface receiving data. <em>(required)</em></li>
<li>Send direct input using default touchset over USB HID if connected. <em>(optional, enabled by default)</em></li>
<li>Send direct input using default touchset over BT if active HID link established. <em>(optional, enabled by default)</em></li>
<li>Send events over USB serial if connected. <em>(optional, enabled by default)</em></li>
<li>Send events over BT if active SPP link established. <em>(optional, enabled by default)</em></li>
</ol>
<p>Aside from these things, there is some other optional behavior which is supported but not planned to be enabled out of the box:</p>
<ol>
<li>Send events over USB HID if connected, using custom HID descriptor. <em>(optional, disabled by default)</em></li>
<li>Send events over BT if active HID link established, using custom HID descriptor. <em>(optional, disabled by default)</em></li>
</ol>
<p>There you have it! A basic overview of different methods of Keyglove communication. This allows something for everyone: the ability to plug it in and watch it work without any extra work, as well as the capability for low-level communication and in-depth customization. Now to finish writing the code to support it all&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/06/05/keyglove-interface-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATTiny44 I2C Slave Feedback Module</title>
		<link>http://www.keyglove.net/2012/06/03/attiny44-i2c-slave-feedback-module/</link>
		<comments>http://www.keyglove.net/2012/06/03/attiny44-i2c-slave-feedback-module/#comments</comments>
		<pubDate>Mon, 04 Jun 2012 03:56:26 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1250</guid>
		<description><![CDATA[Some time ago, I made the decision to move all of the feedback elements of the prototype Keyglove design to a separate I<sup>2</sup>C-controlled module, instead of using direct I/O pin connections. I did this because I also added three new touch sensors and better Bluetooth link and mode detection, and I simply didn't have enough I/O pins to satisfy everything at the same time. The I<sup>2</sup>C bus was already being used by other modules anyway, so adding an additional slave device didn't reduce the number of available pins anywhere else. At the same time, I freed up five whole pins for other functionality (Red, Green, Blue, Vibe, and Piezo). Not bad.]]></description>
				<content:encoded><![CDATA[<p>Some time ago, I made the decision to move all of the feedback elements of the prototype Keyglove design to a separate I<sup>2</sup>C-controlled module, instead of using direct I/O pin connections. I did this because I also added three new touch sensors and better Bluetooth link and mode detection, and I simply didn&#8217;t have enough I/O pins to satisfy everything at the same time. The I<sup>2</sup>C bus was already being used by other modules anyway, so adding an additional slave device didn&#8217;t reduce the number of available pins anywhere else. At the same time, I freed up five whole pins for other functionality (Red, Green, Blue, Vibe, and Piezo). Not bad.<br />
<span id="more-1250"></span></p>
<p>Of course, this turned out to be a bit difficult to accomplish, due to my lack of knowledge about many low-level AVR hardware features (including timers&mdash;*shudder*). I originally hoped I would be able to find an existing chip that did what I needed: 3-channel PWM LED control, on/off digital I/O for the vibrating motor, and frequency-based PWM output for the piezo buzzer. Alas, I found no such device that combined all three of those things together. I guess I shouldn&#8217;t be surprised though; that is a pretty unique combination of functionality to pack into a single dedicated pre-fab IC.</p>
<h3>Building an ATTiny44-Powered I<sup>2</sup>C Slave</h3>
<p>So, I set about finding an alternative. My choices were to put two or three separate existing chips on the same board to achieve enough functionality&mdash;maybe using a couple different PWM control modules&mdash;or to create my own using a fully programmable MCU. The MCU approach seemed a bit overkill until I checked the cost of I<sup>2</sup>C-based PWM modules and compared them with the cost of small AVR modules such as the ATTiny44A (at the moment, <a href="http://www.mouser.com/ProductDetail/Atmel/ATTINY44A-SSU/?qs=MCbhYIqTEtnUvcPTvdetF6SxqP1a1WuA9f2ExdzcTco%3d">$0.83 in single quantities from Mouser</a>).</p>
<p>To make a long story <em>very</em> short, I gave myself a crash course in the ATTinyX4 line of chips, AVR timers, avr-gcc, and the I<sup>2</sup>C protocol. The guys over at <a href="http://www.avrfreaks.net/">AVRfreaks.net</a> were immensely helpful with <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&#038;file=viewtopic&#038;t=117334">pesky objcopy compiler flags</a> with <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&#038;file=viewtopic&#038;t=118250">TWI/USI/timer functionality on ATTinyX4s</a>, and Dean Camera&#8217;s <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&#038;file=viewtopic&#038;t=50106">Newbie&#8217;s Guide to AVR Timers</a> was great as well. The final key that allowed me to fully comprehend timers and interrupts came from reading <a href="http://www.atmel.com/Images/doc8183.pdf">Atmel&#8217;s own datasheet for the ATTiny44A</a>, poring over the timer register descriptions and expected behavior. There was a tremendous &#8220;AHA!&#8221; moment when I rewrote the timer setup portion of my code from scratch while referencing the datasheet, compiled it, and watched it do <em>exactly</em> what I wanted it to on the first try. Amazing.</p>
<p>The I<sup>2</sup>C/TWI/USI implementation was made many orders of magnitude simpler by using Donald R. Blake&#8217;s <a href="https://github.com/jrowberg/keyglove/blob/master/module_code/kgm_feedback/usiTwiSlave.c">usiTwiSlave</a> code with a few modifications. I had to add specific chip support for the ATTinyX4 line (most other ATTiny chips were already supported), and then I added callback functions to START/STOP conditions on the I2C bus (only the START one is used in my code; the STOP callback may not actually work due to USI interrupt vector limitations).</p>
<p>Ladies and gentlemen, we&#8217;ve progressed to the stage where it&#8217;s hard not to justify throwing together a little custom part using a fully programmable microcontroller, simply because they are so darn cheap and flexible. The future is here. (And yes, I realize that this statement will probably seem horribly outdated in a matter of months thanks to Moore&#8217;s Law.)</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/06/IMG_6479.jpg" rel="wp-prettyPhoto[g1250]"><img src="http://www.keyglove.net/wp-content/uploads/2012/06/IMG_6479-300x200.jpg" alt="" title="IMG_6479" width="300" height="200" class="aligncenter size-medium wp-image-1251" /></a></p>
<p>The Eagle schematic and PCB for this module are both available <a href="https://github.com/jrowberg/keyglove/tree/master/hardware/eagle/kgm-feedback">here</a> (always use the latest version, though the one in this post is v2.0).</p>
<h3>Programming the Mounted ATTiny44</h3>
<p>The current &#8220;finished&#8221; code is available on the Keyglove GitHub repository <a href="https://github.com/jrowberg/keyglove/tree/master/module_code/kgm_feedback">here</a>. It uses almost exactly half of the 4K of memory on the ATTiny44 chip, but since the *44 is cheaper than either the *24 or the *84, I decided to go with the *44. What about programming it through? Obviously these things don&#8217;t come preloaded with the feedback module slave code. I did all my testing with a DIP package version of the chip, but on the module itself I used an SOIC-14 chip (to keep the same small form factor I used for the original direct I/O version of the feedback board). To be able to program this, I wired up a 14-pin SOIC test clip with appropriate ISP connections for the ATTiny44:</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/06/IMG_8894.jpg" rel="wp-prettyPhoto[g1250]"><img src="http://www.keyglove.net/wp-content/uploads/2012/06/IMG_8894-300x200.jpg" alt="" title="SOIC-14 ISP Clip" width="300" height="200" class="aligncenter size-medium wp-image-1258" /></a></p>
<p>Incidentally, I ran into two difficulties using this approach, both of which I fixed with a small revision to the PCB. First is that the vibration motor is too close to the MCU, so that when it is mounted, the test clip can&#8217;t grab the IC. This was easily solved by moving the chip a little farther away from the motor. The second issue wasn&#8217;t a <em>problem</em>, but it makes reprogramming the MCU more difficult for anyone who doesn&#8217;t have a test clip&mdash;namely, only four of the typical six ISP header pins are broken out. These (GND, VCC, SDA, SCL) are needed for regular communication with the module. So, I also added a couple of extra header pins to break out MOSI and RESET. Note that the ATTinyX4 line of MCUs shares the same pins for the SPI and I<sup>2</sup>C ports.</p>
<p>I did most of my testing and development without the motor mounted, therefore, and I finally got the code working the way I needed it to. Originally I was trying to pack a whole lot of functionality into it, but after a lot of headache and timer troubleshooting, I decided to just strip it down the exactly the same functionality I had before with direct I/O connections. After all, if I could do it that way before, there shouldn&#8217;t be an problem continuing. In reality, even adding PWM fade capability to the LEDs was a step up from what I had before, which was simple on/off only.</p>
<p>The feedback I<sup>2</sup>C slave module is a write-only device (reading is kind of pointless for this application), and it has the following simple register structure:</p>
<table class="kgtable" width="500">
<thead>
<tr>
<th>Address</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>0&#215;00</th>
<td>RED_LEVEL</td>
<td rowspan="3" valign="middle" style="vertical-align: middle;">0-255 brightness, 0 = off, 255 = full</td>
</tr>
<tr>
<th>0&#215;01</th>
<td>GRN_LEVEL</td>
</tr>
<tr>
<th>0&#215;02</th>
<td>BLU_LEVEL</td>
</tr>
<tr>
<th>0&#215;03</th>
<td>VIB_LEVEL</td>
<td>0 = off, 1 = on (or any non-zero value)</tr>
<tr>
<th>0&#215;04</th>
<td>SPK_LEVEL</td>
<td>0 = off, 1 = on (or any non-zero value)</tr>
<tr>
<th>0&#215;05</th>
<td>SPK_FREQ_H</td>
<td rowspan="2" valign="middle" style="vertical-align: middle;">16-bit tone frequency value</tr>
<tr>
<th>0&#215;06</th>
<td>SPK_FREQ_L</td>
</tr>
</tbody>
</table>
<p>The default value of all LEVEL registers is zero (off), and the default FREQ value is 0x06E0, which is 1760 Hz, or a high A note. Yes, I chose that arbitrarily.</p>
<p>The code makes use of soft PWM control for the LEDs, and timer-based frequency control for the frequency generator. It is probably not the most efficient way to do PWM, but due to the combination of pins needed for three independent LED channels plus a separate timer-based control of the tone output, I couldn&#8217;t figure out a better way, at least with my limited knowledge. Any suggestions are welcome though, if you have any.</p>
<p>The important thing is that the feedback module is now working great while using zero dedicated pins, and I even learned a whole lot about AVR stuff that I didn&#8217;t know before. I call this a success.</p>
<p><em>This recent document from Atmel is also interesting, and may be useful for others (and me, later): <a href="http://www.atmel.com/Images/doc8380.pdf">Atmel AVR290: Avoid Clock Stretch with Atmel tinyAVR</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/06/03/attiny44-i2c-slave-feedback-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actually, Here’s Keyglove Kit v0.4</title>
		<link>http://www.keyglove.net/2012/04/26/actually-heres-keyglove-kit-v0-4/</link>
		<comments>http://www.keyglove.net/2012/04/26/actually-heres-keyglove-kit-v0-4/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 03:33:37 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[kit]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1243</guid>
		<description><![CDATA[So, after extolling all of the electronic virtues of the v0.3 Kit PCB only a few days ago, I&#8217;ve gone ahead and created a new revision of the board already. It turns out that it can indeed be smaller, without sacrificing any of the existing functionality. In [...]]]></description>
				<content:encoded><![CDATA[<p>So, after <a href="http://www.keyglove.net/2012/04/22/keyglove-kit-progress/">extolling all of the electronic virtues of the v0.3 Kit PCB</a> only a few days ago, I&#8217;ve gone ahead and created a new revision of the board already. It turns out that it can indeed be smaller, without sacrificing any of the existing functionality. In fact, v0.4 is a full 25% smaller even than v0.3, giving us a PCB that is now a mere 46% of the original v0.1 board&#8217;s size.<br />
<span id="more-1243"></span></p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/04/Keyglove-Kit-v0.4-PCB.png" rel="wp-prettyPhoto[g1243]"><img src="http://www.keyglove.net/wp-content/uploads/2012/04/Keyglove-Kit-v0.4-PCB-300x190.png" alt="" title="Keyglove Kit v0.4 PCB" width="300" height="190" class="aligncenter size-medium wp-image-1244" /></a></p>
<p>I&#8217;ve just sent in the order for this board, so I won&#8217;t have it in my hands for another two weeks or so. In the mean time, I can definitely work with the v0.3 board I&#8217;ve got built so far. Functionally they are pretty much identical. Here&#8217;s an image that shows the progression in size reduction from v0.1 up through v0.4:</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/04/Keyglove-Kit-Revisions-1-4.jpg" rel="wp-prettyPhoto[g1243]"><img src="http://www.keyglove.net/wp-content/uploads/2012/04/Keyglove-Kit-Revisions-1-4-300x188.jpg" alt="" title="Keyglove Kit Revisions 1-4" width="300" height="188" class="aligncenter size-medium wp-image-1245" /></a></p>
<p>It&#8217;s pretty remarkable, really. The v0.4 board will be <em>much</em> more comfortable on the back of the hand. I&#8217;ve kept much of the same layout, but moved a couple of the modules over to the right side of the Teensy++ board, so that the whole thing can be about 0.1&#8243; narrower and over half an inch shorter. There&#8217;s a kind of &#8220;double wing&#8221; visual effect now, since the various modules now hang off both sides of the board. Although this would never do for a commercial retail product, it is very valuable for the kit version, since it allows the very rigid PCB that actually sits on your hand to be as small as possible. And this time, I really this it is just about as small as possible. There is almost nothing left to rearrange, and doing so at all would require modifying the WT12 module&#8217;s GPIO pins, which I&#8217;m not planning to do since it would make that board much less simple to prototype with on its own.</p>
<h3>Switching to the MPU-6050</h3>
<p>I&#8217;m also now officially switching to SparkFun&#8217;s new <a href="http://www.sparkfun.com/products/11028">MPU-6050 breakout board</a> instead of using their <a href="http://www.sparkfun.com/products/10121">6DOF IMU combo breakout board</a>. Both modules have an accelerometer and gyroscope, but the MPU-6050 does it in a single module, faster, more accurately, with no potential axis alignment issues, with a powerful DMP, <strong>for $25 less</strong>. What&#8217;s not to like?</p>
<p><img alt="MPU-6050 Breakout from SparkFun" src="http://dlnmh9ip6v2uc.cloudfront.net/images/products/11028-01.jpg" title="MPU-6050 Breakout from SparkFun" class="aligncenter" width="300" height="300" /></p>
<p>The v0.4 board still has a dedicated header for the 6DOF IMU board, and the embedded software will continue to have support for both, but it is probably best to get the MPU-6050 board instead if you&#8217;re looking to build your own prototype and you don&#8217;t already have a 6DOF module. It&#8217;s just a better option all around, and saving a whole $25 just like that on the overall cost of the kit is pretty significant, especially with the added benefits of future DMP usage (which is close, but still not functionally useful for the Keyglove just yet).</p>
<p>Next up is fixing the ATTiny44-based feedback module. I still haven&#8217;t managed that, but this v0.4 revision kind of took me by surprise when I started tinkering with the possibility. Ah, the lure of optimization&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/04/26/actually-heres-keyglove-kit-v0-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keyglove Kit Progress</title>
		<link>http://www.keyglove.net/2012/04/22/keyglove-kit-progress/</link>
		<comments>http://www.keyglove.net/2012/04/22/keyglove-kit-progress/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 02:05:02 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[kit]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1210</guid>
		<description><![CDATA[Good news on the kit PCB! I think I&#8217;ve got a winning combination of size, layout, and functionality. I just posted Keyglove Update #17 on the Kickstarter project page yesterday which discusses some of what I&#8217;m going to explain here, but I&#8217;ll summarize that bit again for [...]]]></description>
				<content:encoded><![CDATA[<p>Good news on the kit PCB! I think I&#8217;ve got a winning combination of size, layout, and functionality. I just posted <a href="http://www.kickstarter.com/projects/jrowberg/keyglove-wearable-input-device/posts/212289">Keyglove Update #17</a> on the Kickstarter project page yesterday which discusses some of what I&#8217;m going to explain here, but I&#8217;ll summarize that bit again for those of you who don&#8217;t follow those updates, and include a bit more technical detail here and there.<br />
<span id="more-1210"></span></p>
<p>I ran into a behavioral problem with the last revision of the kit PCB (v0.2), where anytime I plugged in the Teensy++ module, it simply stopped working. Not permanently, but as long as I had it plugged in. The blinking orange light that indicates the device is running would go off and stay off, even though it would work just fine with the USB cable connected but not plugged into the board. The really weird thing is that it would still do this <em>even with no other modules or connections on the kit PCB</em>.</p>
<p>There are no shorts or other components built into the kit board itself&mdash;it&#8217;s just a way to simplify connecting distinct modules together&mdash;so theoretically, plugging the Teensy++ into the kit board is electrically identical to merely extending the header pins by a few inches, give or take. And yet, this made it stop working. I checked for shorts across the power bus and found nothing. A visual inspection of the board also didn&#8217;t help. It just didn&#8217;t work most of the time.</p>
<p>I say &#8220;most of the time&#8221; because there were short spans of time when it would in fact seem to work right; when I touched some part of the Teensy++ module just right or&#8230;I don&#8217;t even know, really. I never figured it out, because I replaced it with a new revision of the board:</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/04/IMG_6571.jpg" rel="wp-prettyPhoto[g1210]"><img src="http://www.keyglove.net/wp-content/uploads/2012/04/IMG_6571-300x200.jpg" alt="" title="IMG_6571" width="300" height="200" class="aligncenter size-medium wp-image-1211" /></a></p>
<p>This board is about as small as it can be without sacrificing functionality or vertically stacking components. It no longer has the internal space for the lithium polymer battery, but if that gets mounted separately on the back of the hand, then the foundational PCB can afford to be smaller, which greatly increases the flexibility possible. The PCB is very rigid, and the v0.2 board was big enough that this rigidity was uncomfortable, even though it was otherwise a very convenient arrangement of parts. Even in kit form, I want this to be comfortable as well as easy, so that&#8217;s what the new revision is. Comfortable and small.</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/04/IMG_6581.jpg" rel="wp-prettyPhoto[g1210]"><img src="http://www.keyglove.net/wp-content/uploads/2012/04/IMG_6581-300x199.jpg" alt="" title="IMG_6581" width="300" height="199" class="aligncenter size-medium wp-image-1212" /></a></p>
<p>Another important technical change, which may possibly have had an effect on the behavior, is that the traces on the board are no longer look like a rats&#8217; nets, full of vias and odd routes. My previous arrangement of touch sensor connections was based on alphabetical order and a very loose correlation of major ports (A, B, C, D, E, F) on the AT90USB microcontroller. However, this doesn&#8217;t make a whole lot of sense, because the sensors wires come to the board in finger or thumb groups that are not alphabetical at all: ABCMNO4, DEFPQR5, and so on. With a purely alphabetical pinout, this results in a mess of wires that cross over each other a lot. The v0.3 pinout instead uses the grouped approach. I have modified the <strong>pins.h</strong> file I&#8217;m working with to reflect this, and even included a handy little ASCII pinout in the code:</p>
<pre><code>
                             __|||||__
                        GND |   USB   | VCC
                3        27 |         | 26        Y
                      SCL 0 |         | 25        Z
                      SDA 1 |         | 24        a*
                      RXD 2 |         | 23        8
                      TXD 3 |         | 22        9
                2         4 |  37.36  | 21        0
                1         5 |         | 20        A
                      LED 6 |         | 19 INT7
                7         7 |         | 18 INT6
                X         8 |         | GND
                W         9 |         | AREF
                V        10 |         | 38        B
                L    5   11 | 32 . 28 | 39  R     C
                K    G   12 | 33 . 29 | 40  Q     M
                J    H   13 | 34 . 30 | 41  P     N
                6    I   14 | 35 . 31 | 42  F     O
                U        15 |         | 43        4
                T        16 |         | 44        D
                S        17 |_________| 45        E
                         
                          36=INT4, 37=INT5
</code></pre>
<p>I will try to create a more helpful graphic diagram with this information before long.</p>
<p>There are a few things to note about this pinout. First, there are three new sensors: <strong>a*</strong>, <strong>9</strong>, and <strong>0</strong>. These aren&#8217;t <em>that</em> new, exactly, but I consider them new since I&#8217;m just now getting around to modifying the code to support them. These three sensors go on the thumb; two are on the back side, behind the nail, and one is on the front side below the two that were there before. This provides a lot of possible functionality, should you choose to use it. Of course, any touchset may include or exclude any sensors you want, allowing you to sacrifice functionality for ease if you choose.</p>
<p>Also note the INT6 and INT7 pins, which are have no sensors connected. These are used for WT12 Bluetooth module management. Technically one of them doesn&#8217;t need to be an interrupt pin because it&#8217;s an output signal (toggling COMMAND mode when a link is active), but it made sense to keep them next to each other, and keeping the interrupt pin otherwise free allows for more future expansion possibilities. While one pin is used to control the device mode, the other keeps an eye on whether there are any active links, which is a very convenient bit of info to have without needing test which mode the module is in, and without running MUX mode all the time (which is convenient and does work, at the expense of more power required).</p>
<p>There you have it. I am very pleased with this revision of the kit board, and it&#8217;s already helping me with my prototyping efforts. I still need to fix one remaining oddity with the ATTiny44-powered feedback module (more on that in a later post), but after that, I have no immediate needs for hardware updates, and I can focus on bringing the embedded software up to speed so that it supports everything I have planned for the current round of features. </p>
<p>You can <a href="https://www.facebook.com/media/set/?set=a.381152548585364.91587.160471600653461&#038;type=3">view a complete photo album showing off the v0.3 board here</a> or below:</p>
<div class="fb-PhotosWrap fb-container" data-paging=""> 
  <div id="" data-next="" data-id="" data-limit="" data-showfburl="" class="fb-PhotoGallery fb-Clear">
<div class="fb-PhotoContainer" data-albumid="" data-page="1" >
               <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=381152561918696&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="381152561918696" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s720x720/555878_381152561918696_927005823_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.3 PCB design, both layers. The OSHW logo is a new addition. This board is 2.75" x 1.5".">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s320x320/555878_381152561918696_927005823_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392288844138401&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392288844138401" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash3/s720x720/522810_392288844138401_474090532_n.jpg" rel="fbgallery[]" title="Here's the new Keyglove Kit v0.3 PCB! This one is much narrower than the v0.2 board--about as small as is physically possible given the necessary connections (unless we started stacking, anyway). The connections are also traced much more intuitively, though the benefits here are invisible due to the fact the header pinouts on the edge of the PCB are the same as before. Just know it's a more intelligent layout.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash3/s320x320/522810_392288844138401_474090532_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392288787471740&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392288787471740" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-prn1/s720x720/553269_392288787471740_1490558237_n.jpg" rel="fbgallery[]" title="...and here's the bottom. The header mounting holes kinda mess up the logo, but I didn't have a smaller one readily available to place differently. Oh well; it still works!">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-prn1/s320x320/553269_392288787471740_1490558237_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392289657471653&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392289657471653" href="http://sphotos-e.ak.fbcdn.net/hphotos-ak-prn1/s720x720/582368_392289657471653_1124948518_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.3 with all female headers mounted--79 pins in all.">
                    <i style="background-image:url(http://sphotos-e.ak.fbcdn.net/hphotos-ak-prn1/s320x320/582368_392289657471653_1124948518_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392289740804978&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392289740804978" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s720x720/575031_392289740804978_1526475206_n.jpg" rel="fbgallery[]" title="KGKit v0.3, alternate view.">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s320x320/575031_392289740804978_1526475206_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392289807471638&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392289807471638" href="http://sphotos-b.xx.fbcdn.net/hphotos-prn1/s720x720/154516_392289807471638_1534102235_n.jpg" rel="fbgallery[]" title="KGKit v0.3, bottom surface.KGKit v0.3, bottom surface.">
                    <i style="background-image:url(http://sphotos-b.xx.fbcdn.net/hphotos-prn1/s320x320/154516_392289807471638_1534102235_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392289907471628&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392289907471628" href="http://sphotos-g.ak.fbcdn.net/hphotos-ak-prn1/s720x720/532670_392289907471628_1828452226_n.jpg" rel="fbgallery[]" title="KGKit v0.3, bottom surface alternate view. I hope this isn't getting boring.">
                    <i style="background-image:url(http://sphotos-g.ak.fbcdn.net/hphotos-ak-prn1/s320x320/532670_392289907471628_1828452226_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290010804951&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290010804951" href="http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash4/s720x720/399115_392290010804951_308830102_n.jpg" rel="fbgallery[]" title="KGKit v0.3 bottom, vertical view.">
                    <i style="background-image:url(http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash4/s320x320/399115_392290010804951_308830102_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290084138277&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290084138277" href="http://sphotos-c.ak.fbcdn.net/hphotos-ak-ash3/s720x720/546609_392290084138277_369231262_n.jpg" rel="fbgallery[]" title="KGKit v0.3 top, vertical view.">
                    <i style="background-image:url(http://sphotos-c.ak.fbcdn.net/hphotos-ak-ash3/s320x320/546609_392290084138277_369231262_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290170804935&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290170804935" href="http://sphotos-e.ak.fbcdn.net/hphotos-ak-prn1/s720x720/543239_392290170804935_2007252528_n.jpg" rel="fbgallery[]" title="KGKit v0.3 + Teensy++ 2.0 board mounted.">
                    <i style="background-image:url(http://sphotos-e.ak.fbcdn.net/hphotos-ak-prn1/s320x320/543239_392290170804935_2007252528_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290230804929&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290230804929" href="http://sphotos-b.xx.fbcdn.net/hphotos-ash3/s720x720/581384_392290230804929_1441599744_n.jpg" rel="fbgallery[]" title="Adding the SparkFun 6DOF IMU module.">
                    <i style="background-image:url(http://sphotos-b.xx.fbcdn.net/hphotos-ash3/s320x320/581384_392290230804929_1441599744_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290270804925&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290270804925" href="http://sphotos-d.ak.fbcdn.net/hphotos-ak-prn1/s720x720/522186_392290270804925_66063163_n.jpg" rel="fbgallery[]" title="Detail of the 6DOF module placement. This is slightly shifted from the v0.2 version of the kit board, in order to allow for a more compact layout.">
                    <i style="background-image:url(http://sphotos-d.ak.fbcdn.net/hphotos-ak-prn1/s320x320/522186_392290270804925_66063163_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290340804918&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290340804918" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-prn1/s720x720/560753_392290340804918_2031978794_n.jpg" rel="fbgallery[]" title="Teensy++ and 6DOF module, alternate view.">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-prn1/s320x320/560753_392290340804918_2031978794_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290407471578&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290407471578" href="http://sphotos-c.ak.fbcdn.net/hphotos-ak-ash3/s720x720/551908_392290407471578_214811290_n.jpg" rel="fbgallery[]" title="Adding the LiPower module.">
                    <i style="background-image:url(http://sphotos-c.ak.fbcdn.net/hphotos-ak-ash3/s320x320/551908_392290407471578_214811290_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290477471571&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290477471571" href="http://sphotos-g.ak.fbcdn.net/hphotos-ak-frc3/s720x720/318293_392290477471571_110873766_n.jpg" rel="fbgallery[]" title="LiPower mounted, vertical view.">
                    <i style="background-image:url(http://sphotos-g.ak.fbcdn.net/hphotos-ak-frc3/s320x320/318293_392290477471571_110873766_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290550804897&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290550804897" href="http://sphotos-c.ak.fbcdn.net/hphotos-ak-prn1/s720x720/521889_392290550804897_451616997_n.jpg" rel="fbgallery[]" title="LiPower mounted, alternate view.">
                    <i style="background-image:url(http://sphotos-c.ak.fbcdn.net/hphotos-ak-prn1/s320x320/521889_392290550804897_451616997_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290630804889&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290630804889" href="http://sphotos-e.ak.fbcdn.net/hphotos-ak-ash3/s720x720/558487_392290630804889_345920200_n.jpg" rel="fbgallery[]" title="Adding the EEPROM module. This is actually the v1 EEPROM module; the v2 module is electrically identical, but has the three address selection solder jumpers on the bottom of the board instead of the top, which allows the whole thing to be only about half as big.">
                    <i style="background-image:url(http://sphotos-e.ak.fbcdn.net/hphotos-ak-ash3/s320x320/558487_392290630804889_345920200_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290690804883&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290690804883" href="http://sphotos-b.xx.fbcdn.net/hphotos-ash3/s720x720/540570_392290690804883_1173152789_n.jpg" rel="fbgallery[]" title="EEPROM module mounted, alternate view.">
                    <i style="background-image:url(http://sphotos-b.xx.fbcdn.net/hphotos-ash3/s320x320/540570_392290690804883_1173152789_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290737471545&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290737471545" href="http://sphotos-d.ak.fbcdn.net/hphotos-ak-ash3/s720x720/529136_392290737471545_199477890_n.jpg" rel="fbgallery[]" title="Adding WT12 Bluetooth module.">
                    <i style="background-image:url(http://sphotos-d.ak.fbcdn.net/hphotos-ak-ash3/s320x320/529136_392290737471545_199477890_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392290770804875&set=a.381152548585364.91587.160471600653461&type=1" data-from="160471600653461" data-id="392290770804875" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s720x720/528543_392290770804875_1764972967_n.jpg" rel="fbgallery[]" title="WT12 mounted, vertical view.">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s320x320/528543_392290770804875_1764972967_n.jpg)"></i>
                </a>
            </div>
                      
    <div class="fb-BottomBar" data-page="1" data-size="large" data-cancomment="" data-next="limit=20&after=MzkyMjkwNzcwODA0ODc1" data-id="381152548585364" ><span class="fb-Loadmore" style="margin: 0 5px"><img src="http://www.keyglove.net/wp-content/plugins/facebook-page-photo-gallery/images/down-pointer.png" /><span id="fb-LoadMoreWall">Show more</span></span></div>
         </div>

    </div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/04/22/keyglove-kit-progress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improved WT12 Bluetooth UART GPIO Breakout</title>
		<link>http://www.keyglove.net/2012/02/20/improved-wt12-bluetooth-uart-gpio-breakout/</link>
		<comments>http://www.keyglove.net/2012/02/20/improved-wt12-bluetooth-uart-gpio-breakout/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 06:07:50 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1141</guid>
		<description><![CDATA[While working on my iWRAP code library for the Bluegiga WT12, one of the problems I've come across is to create a good way to detect and manage active Bluetooth links.]]></description>
				<content:encoded><![CDATA[<p>While working on the <a href="https://github.com/jrowberg/iwrap">iWRAP code library</a> for the Bluegiga WT12, one of the issues I&#8217;ve come across is trying to create a good way to detect and manage active Bluetooth links. The iWRAP firmware, controllable entirely over a simple UART connection, has three different possible modes. As I mentioned in <a href="http://www.keyglove.net/2012/02/19/keyglove-kit-initial-development/">my last post about the Keyglove Kit board</a>, the most efficient solution is to avoid the high-demand MUX mode and instead rely on regular DATA/COMMAND mode switching and active link detection using two GPIO pins.<br />
<span id="more-1141"></span></p>
<p>The previous revision of the WT12 UART breakout board that I created only had the basic UART pins, power pins, and the RESET pin (which I have never actually used in any of my projects, leaving me to wonder at its usefulness). I have now created a new version of that breakout board (up for <a href="http://www.inmojo.com/store/jeff-rowberg/item/wt12-uart-bluetooth-breakout-board/">purchase on InMojo</a>) that includes two broken-out GPIO pins to solve precisely the problem mentioned above.</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/02/IMG_5080.jpg" rel="wp-prettyPhoto[g1141]"><img src="http://www.keyglove.net/wp-content/uploads/2012/02/IMG_5080-300x200.jpg" alt="" title="WT12 UART v1.2" width="300" height="200" class="aligncenter size-medium wp-image-1142" /></a></p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/02/IMG_5081.jpg" rel="wp-prettyPhoto[g1141]"><img src="http://www.keyglove.net/wp-content/uploads/2012/02/IMG_5081-300x200.jpg" alt="" title="WT12 UART v1.2 bottom with headers" width="300" height="200" class="aligncenter size-medium wp-image-1143" /></a></p>
<p>Notice the placement of the extra pins; they are positioned exactly 0.3&#8243; apart from the main 6-pin UART header (which itself is pin-compatible with SparkFun&#8217;s BlueSMiRF boards). This spacing and the horizontal alignment mean this module can if desired be placed across the center of a typical solderless breadboard to allow easy access to all of the pins at the same time.</p>
<p>The iWRAP code that I&#8217;m working on relies on the ability to determine links status and to control mode switching programmatically for the simplest and most efficient operation. This new PCB revision should therefore help me wrap up the code and finish the keyglove&#8217;s Bluetooth integration.</p>
<p>Also, now that Bluegiga has just publicly released their more flexible iWRAP5 beta firmware with full documentation, I should be able to wrap up the customized HID implementation to allow mouse scrolling and few other features that were missing from iWRAP4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/02/20/improved-wt12-bluetooth-uart-gpio-breakout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyglove Kit Initial Development</title>
		<link>http://www.keyglove.net/2012/02/19/keyglove-kit-initial-development/</link>
		<comments>http://www.keyglove.net/2012/02/19/keyglove-kit-initial-development/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 06:43:12 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[kit]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1126</guid>
		<description><![CDATA[One of the things I've been working on is a way to make building a Keyglove yourself much easier, either piecemeal on your own or out of a complete kit.]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve got quite a backlog of updates for you all, seeing as I&#8217;ve been quite busy but haven&#8217;t actually written any real blog posts here for over two months. Some of the updates may end up being bundled together, but my goal is to keep them each focused on a single subject to better explain what&#8217;s going on. We&#8217;ll see. Those of you keeping any eye on the <a href="http://www.twitter.com/keyglove">@keyglove Twitter feed</a> and/or the <a href="http://www.facebook.com/keyglove">Facebook page</a> have undoubtedly seen the steady stream of quick updates and photos that have been posted, but for those relying only on blog posts, I apologize for the apparent silence.</p>
<p>If you need a quick update without waiting for upcoming posts, check out the two links above&mdash;especially the Facebook page&mdash;and read through a bit of the history until sometime back around Christmas.<br />
<span id="more-1126"></span></p>
<h3>Keyglove Kit PCB</h3>
<p>One of the things I&#8217;ve been working on is a way to make building a Keyglove yourself much easier, either piecemeal on your own or out of an eventual complete kit. Although there are <a href="/build">relatively decent instructions available</a> for a partial build already, there are a few reasons why it&#8217;s still pretty hard to do. The biggest problem is that there are just <em>so many connections</em>, especially once you start hooking up the sensors. If you&#8217;re working with a small solderless breadboard for prototyping, it gets insanely messy. And even if you can get all the connections right by hand, the last thing you want to do is have to disconnect even one pin&mdash;especially if it&#8217;s a sensor&mdash;because it can be a big headache to get it plugged back into the right spot.</p>
<p>The recent addition of interrupt-driven motion detection requires the use of the E4 and E5 pins on the Teensy++ board, both of which are internal and not the standard 0.1&#8243; pitch. Adding the WT12 module with the most recent published design isn&#8217;t even possible, since two of the GPIO connections conflict with the RGB/vibe/piezo feedback module. In short, it&#8217;s way too easy to get frustrated with building your own, and that&#8217;s the last thing I want to have happen.</p>
<p>So, I&#8217;ve created a PCB that takes the place of the solderless breadboard, and instead provides a pre-routed board that is essentially just a collection of female or male header blocks, ready for quick connections of pre-built modules or logical sets of sensor cables, where everything is labeled and no jumper wires are necessary. In addition, the physical layout of the board is such that it&#8217;s smaller in every dimension than the solderless breadboard, <em>and</em> it includes a strategically placed empty space to hold the <a href="http://www.sparkfun.com/products/341">recommended lithium polymer battery</a>.</p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/02/Keyglove-Kit-v0.2.png" rel="wp-prettyPhoto[g1126]"><img src="http://www.keyglove.net/wp-content/uploads/2012/02/Keyglove-Kit-v0.2-233x300.png" alt="" title="Keyglove Kit v0.2" width="233" height="300" class="aligncenter size-medium wp-image-1134" /></a></p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/02/eagleUp_Keyglove-Kit-v0.2_board_top_iso.png" rel="wp-prettyPhoto[g1126]"><img src="http://www.keyglove.net/wp-content/uploads/2012/02/eagleUp_Keyglove-Kit-v0.2_board_top_iso-300x168.png" alt="" title="eagleUp_Keyglove Kit v0.2_board_top_iso" width="300" height="168" class="aligncenter size-medium wp-image-1136" /></a></p>
<p><a href="http://www.keyglove.net/wp-content/uploads/2012/02/eagleUp_Keyglove-Kit-v0.2_board_bottom_iso.png" rel="wp-prettyPhoto[g1126]"><img src="http://www.keyglove.net/wp-content/uploads/2012/02/eagleUp_Keyglove-Kit-v0.2_board_bottom_iso-300x168.png" alt="" title="eagleUp_Keyglove Kit v0.2_board_bottom_iso" width="300" height="168" class="aligncenter size-medium wp-image-1137" /></a></p>
<p>While there&#8217;s still a little bit of work that you&#8217;ll have to do to use the internal E4/E5 pins on the Teensy++ board, since they&#8217;re a weird pitch and too small for normal header pin access, the rest of the board is designed for a simple plug-and-play approach. The board accepts a total of six modules:</p>
<ul>
<li><a href="http://www.pjrc.com/store/teensypp.html">Teensy++</a> <em>(required)</em></li>
<li><a href="http://www.sparkfun.com/products/10121">SparkFun 6DOF module</a> <em><strong>or</strong></em> Keyglove 9DOF module</em></li>
<li>Keyglove LiPower module + <a href="http://www.sparkfun.com/products/341">LiPo battery</a></li>
<li>Keyglove Feedback module</li>
<li>Keyglove EEPROM module</li>
<li><a href="http://www.inmojo.com/store/jeff-rowberg/item/wt12-uart-bluetooth-breakout-board/">WT12 UART module</a></li>
</ul>
<p>Note here that the Teensy++ is actually the only part that is strictly required. All you&#8217;ll get is touch detection, but it will work just fine that way. The other modules give you great capabilities like motion control, wireless support, feedback, and more flexible touchset programming, but you can easily get by without one or more of those. The motion sensor module can be either the 6DOF board or the custom Keyglove 9DOF board based on the MPU-6050. (Note that none of the Keyglove modules are available for purchase just yet, but they will be as soon as they are adequately revised and tested.)</p>
<p>Further, instead of being manually connected to the right I/O pins on the Teensy++ board, the sensors are broken out into per-finger headers:</p>
<ul>
<li>1x 6-pin header for the thumb</li>
<li>4x 7-pin header for each other finger</li>
<li>1x 3-pin header for the palm</li>
</ul>
<p>The bottom of the PCB is clearly labeled to indicate which sensor belongs with which pin. This in particular makes the whole process <em>vastly</em> simpler.</p>
<p>Since the LiPower board (USB/battery charger) requires the power from the USB connection but not the D+/D- data lines, we need a good way to &#8220;forward&#8221; those connections straight into the Teensy, since the Teensy also uses a mini USB connection, and it would be a huge pain to have to plug two cables in to the kit board every time you wanted to reprogram it and charge the battery at the same time. Further, the Teensy++ must be modified for 3.3v operation, so the VCC/GND pins from the Teensy can&#8217;t be used for LiPo charging, even if the current draw was supported. On top of that, the Teensy doesn&#8217;t break out the USB D+/D- pins, since under normal circumstances that would be a huge waste of precious board space.</p>
<p>My solution for the Keyglove kit is to use a small USB jumper cable that is connected all the time. The Keyglove LiPower board <em>does</em> break out all five USB lines, so those are brought to a 5-pin header on the edge of the board. This allows a short USB jumper cable (5-pin header on one side, mini USB on the other) to be connected to the Teensy so that the required connections are always present. It&#8217;s not the most elegant solution ever, but I think it pretty much <em>is</em> the most elegant solution that doesn&#8217;t involve a totally custom controller board&mdash;which, of course, is the main goal anyway. The kit is mostly an intermediate/alternative step.</p>
<p>Here are the photos from the <a href="https://www.facebook.com/photo.php?fbid=353033374730615&#038;set=a.345497755484177.84425.160471600653461&#038;type=3">Keyglove Kit v0.2 photo album</a> on Facebook: (the v0.1 design never made it off the ground)</p>
<div class="fb-PhotosWrap fb-container" data-paging=""> 
  <div id="" data-next="" data-id="" data-limit="" data-showfburl="" class="fb-PhotoGallery fb-Clear">
<div class="fb-PhotoContainer" data-albumid="" data-page="1" >
               <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353437321356887&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353437321356887" href="http://sphotos-h.ak.fbcdn.net/hphotos-ak-ash4/s720x720/430539_353437321356887_88357939_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.2 PCB render, top side perspective (Google SketchUp)">
                    <i style="background-image:url(http://sphotos-h.ak.fbcdn.net/hphotos-ak-ash4/s320x320/430539_353437321356887_88357939_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353437241356895&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353437241356895" href="http://sphotos-b.ak.fbcdn.net/hphotos-ak-frc1/s720x720/428155_353437241356895_218040722_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.2 PCB render, bottom side perspective (Google SketchUp)">
                    <i style="background-image:url(http://sphotos-b.ak.fbcdn.net/hphotos-ak-frc1/s320x320/428155_353437241356895_218040722_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353437818023504&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353437818023504" href="http://sphotos-c.ak.fbcdn.net/hphotos-ak-ash4/s720x720/417367_353437818023504_1967083157_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.2 PCB render, top side">
                    <i style="background-image:url(http://sphotos-c.ak.fbcdn.net/hphotos-ak-ash4/s320x320/417367_353437818023504_1967083157_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353437634690189&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353437634690189" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-prn1/s720x720/406391_353437634690189_1679889773_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.2 PCB render, bottom side">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-prn1/s320x320/406391_353437634690189_1679889773_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=345497868817499&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="345497868817499" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/422448_345497868817499_137928564_n.jpg" rel="fbgallery[]" title="I haven't even received the v0.1 shipment of this board yet, and I already have a replacement board designed. This one even has a cool Keyglove logo in the silkscreen.

Important differences include on-board labels for all of the connectors, rearranged modules, new I2C-based feedback board connection, and the removal of the external SRAM module. There were not enough connections for the SRAM module anyway, so dropping it from the kit board is not a big deal. Now to get this thing ordered and tested!">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s320x320/422448_345497868817499_137928564_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033341397285&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033341397285" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/403264_353033341397285_1957641194_n.jpg" rel="fbgallery[]" title="Female crimp pins, 1x7 female header blocks, and the crimp tool from Pololu. The 1x7 blocks are for each of the four fingers, while the thumb takes a 1x6 block, the palm takes a 1x3 block, and the USB jumper cable takes a 1x5 block. The crimp tool works very well, but I need more practice with it.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s320x320/403264_353033341397285_1957641194_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033374730615&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033374730615" href="http://sphotos-a.xx.fbcdn.net/hphotos-frc1/s720x720/405526_353033374730615_1006253134_n.jpg" rel="fbgallery[]" title="Since the LiPower board (USB/battery charger) requires the power from the USB connection but not the D+/D- data lines, we need a good way to "forward" those connections straight into the Teensy. My solution is a small USB jumper cable. We start, of course, with a regular mini USB cable.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-frc1/s320x320/405526_353033374730615_1006253134_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033404730612&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033404730612" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/395510_353033404730612_335921618_n.jpg" rel="fbgallery[]" title="Cut that cable so that the mini USB connector has about five inches of wire left. The rest will be discarded.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s320x320/395510_353033404730612_335921618_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033428063943&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033428063943" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/397025_353033428063943_989292102_n.jpg" rel="fbgallery[]" title="The cable now has two ends: one is a mini USB connector, and the other is raw wire.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s320x320/397025_353033428063943_989292102_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033441397275&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033441397275" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash4/s720x720/426210_353033441397275_1489751604_n.jpg" rel="fbgallery[]" title="Strip a little less than an inche of the main external insulation off the raw end.">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash4/s320x320/426210_353033441397275_1489751604_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033471397272&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033471397272" href="http://sphotos-d.ak.fbcdn.net/hphotos-ak-ash3/s720x720/427251_353033471397272_622598462_n.jpg" rel="fbgallery[]" title="Here are the required parts: one crimp tool, one partial USB cable, one 1x5 femail header block, and four female crimp pins (or five if you have a 5-wire USB cable that includes the ID line).">
                    <i style="background-image:url(http://sphotos-d.ak.fbcdn.net/hphotos-ak-ash3/s320x320/427251_353033471397272_622598462_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033491397270&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033491397270" href="http://sphotos-a.xx.fbcdn.net/hphotos-frc1/s720x720/420425_353033491397270_915291162_n.jpg" rel="fbgallery[]" title="The red is +5V, black is GND, white is D+, and green is D-. Strip about 1/8 inch of insulation off the ends of each individual wire.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-frc1/s320x320/420425_353033491397270_915291162_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033511397268&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033511397268" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/401245_353033511397268_1645725605_n.jpg" rel="fbgallery[]" title="Following Pololu's directions, you should end up with this after crimping the pins on the ends of each wire.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s320x320/401245_353033511397268_1645725605_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=353033521397267&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="353033521397267" href="http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash4/s720x720/401373_353033521397267_1730170250_n.jpg" rel="fbgallery[]" title="Insert the pins into the 1x5 header block in this order: +5V, D+, D-, (ID if you have it), GND. That should be Red, White, Green, [ID], Black. Voila! Easy USB jumper cable for the Keyglove kit board. Hopefully I can find these pre-made somewhere, or at least sell them this way.">
                    <i style="background-image:url(http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash4/s320x320/401373_353033521397267_1730170250_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392665714100714&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="392665714100714" href="http://sphotos-h.ak.fbcdn.net/hphotos-ak-ash3/s720x720/530087_392665714100714_1626164396_n.jpg" rel="fbgallery[]" title="Keyglove Kit v0.2 in a lightbox. This board has a lot of promise, but it's a bit big and I think the PCB trace placement is wreaking havoc on some of the fast-switching signals. It's hard to say, but it's been retired in favor of v0.3 largely due to the size.">
                    <i style="background-image:url(http://sphotos-h.ak.fbcdn.net/hphotos-ak-ash3/s320x320/530087_392665714100714_1626164396_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=392665770767375&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="392665770767375" href="http://sphotos-g.ak.fbcdn.net/hphotos-ak-prn1/s720x720/156124_392665770767375_948302591_n.jpg" rel="fbgallery[]" title="Bottom of the v0.2 board. I really like the Keyglove logo in the silkscreen.">
                    <i style="background-image:url(http://sphotos-g.ak.fbcdn.net/hphotos-ak-prn1/s320x320/156124_392665770767375_948302591_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=369961659704453&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="369961659704453" href="http://sphotos-a.xx.fbcdn.net/hphotos-prn1/s720x720/426343_369961659704453_852601148_n.jpg" rel="fbgallery[]" title="Fabricated Keyglove Kit v0.2 PCB in all its glory! This is the top side.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-prn1/s320x320/426343_369961659704453_852601148_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=369961619704457&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="369961619704457" href="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/430357_369961619704457_339789382_n.jpg" rel="fbgallery[]" title="Fabricated Keyglove Kit v0.2 PCB in all its glory...again! This is the bottom side.">
                    <i style="background-image:url(http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s320x320/430357_369961619704457_339789382_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=369961696371116&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="369961696371116" href="http://sphotos-d.ak.fbcdn.net/hphotos-ak-ash4/s720x720/417359_369961696371116_377499082_n.jpg" rel="fbgallery[]" title="A full array of headers requires 92 female and male pins (each), and 42 right-angle male pins.">
                    <i style="background-image:url(http://sphotos-d.ak.fbcdn.net/hphotos-ak-ash4/s320x320/417359_369961696371116_377499082_n.jpg)"></i>
                </a>
            </div>
                            <div class="fb-PhotoThumbWrap">
                <a id="" target="_blank" class="fb-PhotoThumbLink fb-PhotoThumbnail fb-PhotoLargeThumb" data-cancomment="" data-viewonfb="" data-fburl="http://www.facebook.com/photo.php?fbid=369961736371112&set=a.345497755484177.84425.160471600653461&type=1" data-from="160471600653461" data-id="369961736371112" href="http://sphotos-f.ak.fbcdn.net/hphotos-ak-frc1/s720x720/422555_369961736371112_2119017598_n.jpg" rel="fbgallery[]" title="Here's what the assembled kit board looks like on top...">
                    <i style="background-image:url(http://sphotos-f.ak.fbcdn.net/hphotos-ak-frc1/s320x320/422555_369961736371112_2119017598_n.jpg)"></i>
                </a>
            </div>
                      
    <div class="fb-BottomBar" data-page="1" data-size="large" data-cancomment="" data-next="limit=20&after=MzY5OTYxNzM2MzcxMTEy" data-id="345497755484177" ><span class="fb-Loadmore" style="margin: 0 5px"><img src="http://www.keyglove.net/wp-content/plugins/facebook-page-photo-gallery/images/down-pointer.png" /><span id="fb-LoadMoreWall">Show more</span></span></div>
         </div>

    </div>
</div>
<h3>Design Changes for 37 Sensor Connections and Bluetooth GPIO</h3>
<p>One thing that I&#8217;ve finally been able to accomplish is to allow a full 37-sensor design with the Teensy++ board, which was previously not possible due to a shortage of I/O pins. Since I added three extra sensors on the thumb for more flexibility, I&#8217;ve been resigned to the fact that I just wouldn&#8217;t be able to use all 37 in the Teensy-powered version, but instead only in the full production version. This is no longer the case.</p>
<p>I&#8217;ve taken the feedback module and converted it into an I2C slave device, which means it&#8217;s now going to use just the SDA/SCL lines on the Teensy (which are already used for other I2C devices anyway). This freed up five whole I/O lines&mdash;red, green, blue, vibration, and piezo&mdash;which have been reassigned to the final three sensor connections (labeled <em><strong>9, 0,</strong></em> and <em><strong>a*</strong></em>) and the two newly added GPIO connections from the Bluetooth module.</p>
<p>The GPIO additions are even more important at this stage than just those last three sensors, honestly, because without any GPIO access, some of the WT12 control becomes significantly harder to accomplish. The iWRAP firmware on the WT12 has two different modes: COMMAND mode and DATA mode. Whenever a Bluetooth link is active, the modules switches to DATA mode, and to take it out of this mode requires an escape sequence (those familiar with old-school modems may remember the typical &#8220;+++&#8221; escape sequence they used). However, the HID protocol used by the Keyglove actually <em>ignores</em> this escape sequence, since it is reasonable to assume that someone might at some point want to type &#8220;+++&#8221; without spontaneously altering the state of their wireless keyboard connection.</p>
<p>This leaves a third mode, known as MUX mode or multiplexing mode, where each command or data transmission is wrapped in a special framing packet so that both can be sent at the same time. This works, but it is much more resource-intensive for the WT12&#8242;s internal processor, and is therefore more limiting that I would like. GPIO access completely solves this problem by providing a very simple way to trigger a switch to COMMAND mode whenever necessary, and by providing a way to tell whether there are any active Bluetooth connections without querying the device over the UART connection. This will be extremely beneficial.</p>
<p>So what about that new I2C slave feedback module? It isn&#8217;t finished yet, but it&#8217;s now powered by an ATTiny44 MCU doing the heavy lifting of some PWM fading code, piezo frequency control, and of course the I2C protocol transmissions. It&#8217;s almost done, but not quite. The ATTiny&#8217;s code is <a href="https://github.com/jrowberg/keyglove/blob/master/module_code/kgm_feedback/kgm_feedback.c">available on GitHub</a> in its current state.</p>
<p>Keep watching for more info. There should be some very good news about a glove manufacturer shortly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2012/02/19/keyglove-kit-initial-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VIDEO: Wireless Mouse Movement Demo</title>
		<link>http://www.keyglove.net/2011/12/04/video-wireless-mouse-movement-demo/</link>
		<comments>http://www.keyglove.net/2011/12/04/video-wireless-mouse-movement-demo/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 18:22:00 +0000</pubDate>
		<dc:creator>Jeff Rowberg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[iwrap]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.keyglove.net/?p=1113</guid>
		<description><![CDATA[I have managed to incorporate the Bluegiga WT12 sufficiently into the current prototype hardware, along with the still-in-progress iWRAP code library to control it easily and transparently. This video demonstrates the first true combination of Bluetooth wireless functionality and the actual Keyglove code, rather than just a proof-of-concept Arduino sketch.]]></description>
				<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/33096786" width="608" height="342" frameborder="0"></iframe>
<p><a href="http://vimeo.com/33096786">Keyglove #09 &#8211; Wireless Mouse Movement Demo</a> from <a href="http://vimeo.com/sectorfej">Jeff Rowberg</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>Finally! I have managed to incorporate the Bluegiga WT12 sufficiently into the current prototype hardware, along with the still-in-progress iWRAP code library to control it easily and transparently. This video demonstrates the first true combination of Bluetooth wireless functionality and the actual Keyglove code, rather than just a proof-of-concept Arduino sketch. This is a major milestone; wrapping up the remaining core Bluetooth functionality should be pretty straightforward now.<br />
<span id="more-1113"></span></p>
<p>For a quick summary: the board in the video is the same prototype that I&#8217;ve been using for a while, powered by the Teensy++ and SparkFun 6DOF module for motion detection. The WT12 Bluetooth module makes it wireless, and a 3.7v LiPo battery powers it all. The glove itself is not attached for this demo, due to the fact that there would be way too many wires there for me to be able to do the quick and frequent adjustments to the board that I&#8217;m doing at this time. The touch sensors are working fine, however, and wireless keyboard input would be working as well here if it were connected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.keyglove.net/2011/12/04/video-wireless-mouse-movement-demo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: www.keyglove.net @ 2013-06-19 08:18:19 by W3 Total Cache -->
