{"id":29,"date":"2010-10-12T23:36:29","date_gmt":"2010-10-13T03:36:29","guid":{"rendered":""},"modified":"2011-02-01T23:45:35","modified_gmt":"2011-02-02T04:45:35","slug":"spiffchorder-progress","status":"publish","type":"post","link":"https:\/\/pappp.net\/?p=29","title":{"rendered":"Spiffchorder Progress"},"content":{"rendered":"\n<p>As I mentioned when the <a class=\"externlink\" title=\"Go to http:\/\/pappp.net\/?p=31\" href=\"http:\/\/pappp.net\/?p=31\">parts arrived<\/a>, I recently decided I wanted to build myself a <a class=\"externlink\" title=\"Go to http:\/\/chorder.cs.vassar.edu\/spiffchorder\/forside\" href=\"http:\/\/chorder.cs.vassar.edu\/spiffchorder\/forside\">Spiffchorder<\/a> to play with, and, more generally, play with the <a class=\"externlink\" title=\"Go to http:\/\/www.obdev.at\/products\/vusb\/index.html\" href=\"http:\/\/www.obdev.at\/products\/vusb\/index.html\">VUSB Stack<\/a>, which provides software USB for most AVR microcontrollers, using a few cents worth of extra passive components.  This seems to be an excellent generic solution to the &#8220;Modern computers don&#8217;t have hobby-accessible I\/O&#8221; problem for most applications.  I&#8217;ve actually been using a VUSB device for a while since <a class=\"externlink\" title=\"Go to http:\/\/pappp.net\/?p=203\" href=\"http:\/\/pappp.net\/?p=203\">my usbtiny AVR programmer<\/a> is an  ATTiny2313 running VUSB with some additional support chips and code.<\/p>\n<p>When I ordered parts, Newark was out of suitably-packaged ATMega168 chips, and their larger (RAM\/ROM), pin-compatible sibling the ATMega328p was so close in cost I would have ordered them anyway.  There is a <a class=\"externlink\" title=\"Go to http:\/\/vusb.wikidot.com\/troubleshooting\" href=\"http:\/\/vusb.wikidot.com\/troubleshooting\">warning<\/a>(#8) about -p suffix chips (stands for PicoPower, meaning some additional power staving features) and VUSB, but it seems to be a simple problem with naming conventions in the interrupt vectors, and is fixed in recent versions.<br \/>\nI&#8217;ve been grabbing an hour here and there to put it together over the last week.  So far, I&#8217;ve already spent some time on one of my favorite activities&#8230;<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/fp-content\/images\/spiffwork_sm.jpg\" alt=\"spiffwork_sm.jpg\"  title=\"spiffwork_sm.jpg\"  class=\"center\"  width=\"500\" height=\"375\" \/><br \/>\nwhich produced a nice tight board (The back isn&#8217;t <em>quite<\/em> as neat, and the socket I ended up using suuccckkkks)<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/fp-content\/images\/spiffboard_sm.jpg\" alt=\"spiffboard_sm.jpg\"  title=\"spiffboard_sm.jpg\"  class=\"center\"  width=\"500\" height=\"375\" \/><br \/>\nwhich, as far as I&#8217;ve discovered, had only one assembly error (the pull-up network on D- was between ground and&#8230; ground because I counted wrong), which was easily remedied.<br \/>\nWhile I was assembling I also put together a half-assed first approximation keyboard to test with<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/fp-content\/images\/spiffkeys_sm.jpg\" alt=\"spiffkeys_sm.jpg\"  title=\"spiffkeys_sm.jpg\"  class=\"center\"  width=\"500\" height=\"667\" \/><br \/>\nWhich will eventually be upgraded&#8230; I&#8217;m thinking something flexible that can be clipped to the outside of my left pants pocket, or flopped on a flat surface such that the clip maintains the curvature, but I really just want to play with it and see how (un?)comfortable it is to use a chording keyboard.  Maybe I&#8217;ll get bored and build a key-glove, those always look fun (and useless).<\/p>\n<p>Now for the real problems&#8230; even after I fixed the wiring glitch, and touched up the code (minor fixes to make it recognize the 328p and set the fuses correctly), I wasn&#8217;t getting anything when plugged into USB.  I borrowed a 168 from another project (and transparently swapped in a 328p there) to test the <a class=\"externlink\" title=\"Go to http:\/\/symlink.dk\/projects\/spiffchorder\/\" href=\"http:\/\/symlink.dk\/projects\/spiffchorder\/\">vanilla code<\/a>, and it resulted in a board that generates a stream of errors like<\/p>\n<pre>usb&nbsp;2-1.1.3:&nbsp;new&nbsp;low&nbsp;speed&nbsp;USB&nbsp;device&nbsp;using&nbsp;ehci_hcd&nbsp;and&nbsp;address&nbsp;15\nusb&nbsp;2-1.1.3:&nbsp;device&nbsp;descriptor&nbsp;read\/64,&nbsp;error&nbsp;-32\n<\/pre>\n<p>when plugged into any of my various Linux boxes.  I then decided to upgrade the VUSB version (the one the 0.98 release is built against is truly ancient), which only took a few minutes of tampering to set up the usbconfig.h (and Makefile) to work with the Spiffchorder sources and IDs.  Unfortunately, this only fixed the 328p problem&#8230; it now does exactly the same thing as the vanilla 168 version, and produces a string of USB enumeration errors when plugged in. <\/p>\n<p>My understanding is that -32 errors are usually something to do with devices that aren&#8217;t correctly handled by ECHI (USB2) mode controllers, but a device that requires you disable ehci mode on a modern computer is pretty much useless, and it doesn&#8217;t appear VUSB should have that limitation.  <a href=\"http:\/\/pappp.net\/wp-content\/fp-content\/attachs\/spiffchordernewvusb_328.zip\">This<\/a> is my current working tree, it seems to be at least as sound as the distributed version; when I get it working I&#8217;ll ping the original author about the update, and replace these if it turns out to be a software problem.   I&#8217;m going to hook it up to some instrumentation on campus tomorrow to see if I can find the problem, I suspect something screwy with the voltages on the USB Data lines. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I mentioned when the parts arrived, I recently decided I wanted to build myself a Spiffchorder to play with, and, more generally, play with the VUSB Stack, which provides software USB for most AVR microcontrollers, using a few cents &hellip; <a href=\"https:\/\/pappp.net\/?p=29\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8,6,1,10,12],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-computers","category-diy","category-entertainment","category-general","category-objects","category-oldblog"],"_links":{"self":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":0,"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}