{"id":468,"date":"2011-11-25T20:24:29","date_gmt":"2011-11-25T18:24:29","guid":{"rendered":"http:\/\/tomashg.com\/?p=468"},"modified":"2012-02-15T15:57:53","modified_gmt":"2012-02-15T13:57:53","slug":"sp-button-pad-controller-act-ii-adventures-in-the-avrland","status":"publish","type":"post","link":"https:\/\/tomashg.com\/?p=468","title":{"rendered":"SP Button Pad Controller ACT II (adventures in the AVRland)"},"content":{"rendered":"<p><a href=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/11\/DSC01053X.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-medium wp-image-489\" title=\"DSC01053X\" src=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/11\/DSC01053X-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/tomashg.com\/wp-content\/uploads\/2011\/11\/DSC01053X-300x225.jpg 300w, https:\/\/tomashg.com\/wp-content\/uploads\/2011\/11\/DSC01053X-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Since things didn&#8217;t work out as smoothly as I expected, no proper information on the net, nor anyone wrote a library for it; spent few sleepless nights trying to figure it out,\u00a0things\u00a0seemed doomed.. I decided to contact Spark Fun for more technical info. Within an hour they answered me, was really helpful but tried to answer as much as he could and gave me a fresh set of ideas.<\/p>\n<p>After going through the <a href=\"http:\/\/www.sparkfun.com\/datasheets\/Widgets\/ButtonPadController-USB_v24.pdf\" target=\"_blank\">schematics<\/a> of the board and its original <a href=\"http:\/\/www.sparkfun.com\/Code\/ButtonPadControllerUSB_v15.zip\" target=\"_blank\">firmware code<\/a>, I realized that the USB board has two <a href=\"http:\/\/www.atmel.com\/dyn\/products\/product_card.asp?part_id=4720\" target=\"_blank\">ATmega328<\/a> micro-controllers. As opposed to the ISP board that has only one that controls the LED and button matrix . Basically the USB board acts as an ISP board with a built in &#8220;Arduino&#8221; to control it. So the idea was to burn an Arduino bootloader onto the Master controller and just use it as an Arduino, easy I thought.<\/p>\n<p>Not so much as it \u00a0turned out. I needed an AVR\u00a0programmer, which\u00a0of course\u00a0I did not have. But fear not, to the rescue came the <a href=\"http:\/\/www.sparkfun.com\/products\/9218\" target=\"_blank\">Arduino Mini Pro<\/a> boards I got earlier, they can be rigged and used as <a href=\"http:\/\/arduino.cc\/en\/Tutorial\/ArduinoISP\" target=\"_blank\">programmers<\/a> (sounds like a fun party). Furthermore, I had to do a small dirty trick to disable reset on the Mini Pro, basically put a\u00a0capacitor\u00a0between the Reset and Ground pins. But none of the\u00a0boot loaders\u00a0worked properly and I was getting desperate again. Also the board lost its USB API so I tried to re-compile and restore its original firmware. \u00a0And so it struck me, why not just modify the existing firmware to send midi data directly whenever a button is pressed and also light up that button. Of course this would be the optimal solution\u00a0as I would not need a driver application to run the whole thing, just route the MIDI traffic through to my applications.<\/p>\n<p>After more than 5 days of less than 3 hours sleep per day, endless testing, trial by error and just\u00a0aimlessly\u00a0poking around I finally get a MIDI signal and a led on! Victory! The firmware still needs a lot of optimization but at least now I know I&#8217;m on the correct track, and can finally get a good night&#8217;s sleep without commands and diagrams on my mind!<br \/>\n<iframe width=\"560\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/SWqZyFSdzLw\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since things didn&#8217;t work out as smoothly as I expected, no proper information on the net, nor anyone wrote a library for it; spent few sleepless nights trying to figure it out,\u00a0things\u00a0seemed doomed.. I decided to contact Spark Fun for more technical info. Within an hour they answered me, was really helpful but tried to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79,112,32],"tags":[80,106,105,107,104,108,94,93,99,100,101],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-arduino","category-controllers","category-technology","tag-arduino-2","tag-atmega","tag-avr","tag-bootloader","tag-buttom-pad","tag-isp","tag-midi","tag-monome","tag-sparkfun","tag-spi","tag-usb"],"_links":{"self":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=468"}],"version-history":[{"count":13,"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/tomashg.com\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions\/529"}],"wp:attachment":[{"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomashg.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}