<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-824114889882641219</id><updated>2012-02-01T08:15:58.157-08:00</updated><category term='Arduino shield'/><category term='64-bit'/><category term='toaster oven soldering'/><category term='M5451'/><category term='reconfigurable hardware'/><category term='Cypress'/><category term='Rainbowduino'/><category term='juiced pyshell'/><category term='sensor networks'/><category term='python html'/><category term='LED driver'/><category term='pin definition'/><category term='OSS'/><category term='discovercircuits'/><category term='cooperative robotics'/><category term='Brevia'/><category term='pyshell'/><category term='CCShield'/><category term='constant current'/><category term='Arduino'/><category term='Lattice'/><category term='python'/><category term='browser game automation'/><category term='html'/><category term='XP2'/><category term='pyxpcomext'/><category term='AVR'/><category term='CPLD'/><category term='Open hardware'/><category term='placement'/><category term='Ubuntu'/><category term='embedded hardware development'/><category term='LM334'/><category term='PSOC'/><category term='xpcom'/><category term='SMT soldering'/><category term='LED'/><category term='FPGA'/><category term='Lightuino'/><category term='Brevia lpf file'/><category term='Diamond'/><title type='text'>effluvia of a scattered mind</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-1555000852030183084</id><published>2012-01-31T10:01:00.000-08:00</published><updated>2012-01-31T10:01:26.967-08:00</updated><title type='text'>Ubuntu 11.10/Gnome 3.0: Surviving the transition!</title><content type='html'>&lt;div class="tr_bq"&gt;I've had significant issues with the new Ubuntu GUI and Gnome 3.0; ranging from irritations (difficulty to create launchers) to bugs (mouse stops responding).&amp;nbsp; If you are googling around I'm sure you've seen the near universal cry of dismay.&amp;nbsp; If there is one message to send Canonical (if any of you ever read this posting) it would be that while its a great idea to "dumb down" the interface so a single GUI will work between your desktop and touch machines, you can't &lt;i&gt;disable&lt;/i&gt; the advantages available through a mouse interface!&lt;/div&gt;&lt;br /&gt;Anyway, here is what I did to make it workable.&amp;nbsp; These are mostly culled from various web sources; they are not my original work.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1. Install Linux Mint &lt;a href="http://www.linuxmint.com/"&gt;http://www.linuxmint.com/&lt;/a&gt; instead.&amp;nbsp; This is a "downstream" distribution from Ubuntu (i.e. its a customized Ubuntu) so you won't be moving that far from what is familiar.&amp;nbsp; But you will get a Gnome 3 customized for people who preferred Gnome 2.&lt;br /&gt;&lt;br /&gt;2. Enable all apps to show up in the "Startup Applications":&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&amp;nbsp;sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop&lt;/blockquote&gt;3.&amp;nbsp;&amp;nbsp; Put most "window" buttons on the left, but "close" on the right side:&lt;br /&gt;&lt;blockquote&gt;gconftool-2 -s -t string /desktop/gnome/shell/windows/button_layout "menu,maximize,minimize:close"&lt;/blockquote&gt;4. Add the ability to right click on the desktop to create a new launcher (launchers are icons that run programs):&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;echo "gnome-desktop-item-edit ~/Desktop/ --create-new" &amp;gt; ~/.gnome2/nautilus-scripts/Create\ New\ Launcher&lt;br /&gt;chmod a+x ~/.gnome2/nautilus-scripts/Create\ New\ Launcher&lt;/blockquote&gt;&lt;br /&gt;5. Right click on the desktop-&amp;gt;Scripts-&amp;gt;Create New Launcher to create launchers for your key programs.&lt;br /&gt;&lt;br /&gt;5a.&amp;nbsp; Here's a launcher I use to automatically connect into multiple virtual machines:&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;/usr/bin/gnome-terminal --window --command "ssh -X -A root@192.168.1.200" --tab --command&amp;nbsp; "ssh -X -A root@192.168.1.201" --tab --command "ssh -X -A root@192.168.1.202" --tab --command "ssh -X -A root@192.168.1.203" --tab --command "ssh -X -A root@192.168.1.204"&lt;/blockquote&gt;5b.&amp;nbsp; You can use the same thing to log in a multiple users.&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;/usr/bin/gnome-terminal --window --command "ssh -X -A me@localhost" --tab --command "ssh -X -A minime@localhost" --tab --command "ssh -X -A maxime@localhost"&lt;/blockquote&gt;6. Multiple gmail/firefox sessions.&amp;nbsp; Even if you spawn firefox from different users to use multiple gmail accounts, it outsmarts you by checking the desktop to see whether firefox is already running.&amp;nbsp; If it is it just uses that program.&amp;nbsp; To defeat that, run firefox like this "firefox --no-remote".&amp;nbsp; I made a simple script called 'ff':&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;sudo -i&lt;br /&gt;cd /usr/bin&lt;br /&gt;echo "firefox --no-remote" &amp;gt; ff&lt;br /&gt;chmod a+x ff&lt;/blockquote&gt;7. Head on over to menu-&amp;gt;other-&amp;gt;advanced settings-&amp;gt;desktop and turn everything "on".&amp;nbsp; You might want to peruse the other settings as well...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. Install the gnome config editor and really start tweaking:&lt;br /&gt;apt-get -y install gconf-editor&lt;br /&gt;&lt;br /&gt;8a. Multi-monitor workspace "bug" -- the workspace does not change on one monitor&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; go to: gconf-editor -&amp;gt; /desktop/gnome/shell/windows/workspaces_only_on_primary and uncheck it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Important keys:&lt;br /&gt;&lt;br /&gt;ALT-F2: then "r"&amp;nbsp; restarts the desktop without losing your windows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;That's it!&amp;nbsp; Your desktop should now be usable! :-)&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;Please post any other tricks you discover.&amp;nbsp; Especially:&lt;br /&gt;&lt;br /&gt;1. How do I add launchers to the top/bottom bar?&lt;br /&gt;&lt;br /&gt;2. How do I specify the total number of workspaces (not have them be dynamically created)?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-1555000852030183084?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/1555000852030183084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/ubuntu-1110gnome-30-surviving.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1555000852030183084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1555000852030183084'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/ubuntu-1110gnome-30-surviving.html' title='Ubuntu 11.10/Gnome 3.0: Surviving the transition!'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-545795048458341127</id><published>2012-01-27T19:23:00.000-08:00</published><updated>2012-02-01T08:15:58.227-08:00</updated><title type='text'>Transdescending Arduino: Going cheap and small</title><content type='html'>The Arduino is great; a microController you can actually do something with for 30 bucks!&amp;nbsp; Ok, but your train layout needs 5 of them ($150), your home sensor network needs 10 + $40 xbee cards (clocking in at $700!).&amp;nbsp; Or the mere fact that your want to KEEP your projects around means that you get nailed for 30 bucks over and over again.&lt;br /&gt;&lt;br /&gt;But wait a second... the AVR328p is a 3 dollar chip!&amp;nbsp; And the AVR ATMega48 (pin compatible but with a LOT less space) is 2 bucks (for 10)!&amp;nbsp; And if your requirements are extremely minimal, there's the ATTINY13 which comes in as little as 60 cents -- but in an inconvenient package (you'll be better off spending another 4 dimes and getting one for 1 buck). &lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Choosing Parts&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first step is getting your part.&amp;nbsp; This can be tricky because paradoxically there are both too many parts and too few.&amp;nbsp; By "too many" I mean is that since there are literally hundreds of AVR parts to choose from, it can be hard to pick what you need.&amp;nbsp; So your first stop should be the Atmel "parametric" selector &lt;a href="http://www2.atmel.com/PFResults.aspx#%28data:%28area:%27%27,category:%27163[607]%27,mature:%21t,pm:%21%28%28i:1197,v:%21%280,13%29%29,%28i:2324,v:%21%280,9%29%29,%28i:2325,v:%21%280,6%29%29,%28i:1683,v:%21%281%29%29%29,view:table%29,sc:1%29"&gt;here&lt;/a&gt; (most vendors have parametric selectors on their web sites but they can be hard to find).&amp;nbsp; I've already selected the basic stuff in that link (like 8 bit AVR) but there are still hundreds of possibilities.&lt;br /&gt;&lt;br /&gt;Another excellent way to narrow it down is to pick choices that other people have already used.&amp;nbsp; These can be found by looking in the Arduino or Adafruit forums, www.avrfreaks.net, or more eye candy sites like www.hackaday.com. &lt;br /&gt;&lt;br /&gt;Or pick from these popular choices:&amp;nbsp; ATMEGA328 (Uno), ATMEGA168 (like Uno but 16k ram), ATMEGA48 (Uno, 4k RAM).&amp;nbsp; ATTINY24, ATTINY13 (no serial), ATTINY2313 (a "tiny" with serial).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Navigating Parts Suppliers&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you've found some candidates, you'll want to head over to &lt;a href="http://www.findchips.com/"&gt;www.findchips.com&lt;/a&gt; to see if there are any for sale in a package you can handle.&amp;nbsp; This is where you may find there are "too few" parts -- that awesome device perfect for your job is not stocked and only available in 1000 units! :-(&lt;br /&gt;&lt;br /&gt;So you'll need to do a bit of back-and-forth between the parametric table and the marketplaces to find what you need. &lt;br /&gt;&lt;br /&gt;Another choice is to head directly to&lt;a href="http://www.digikey.com/"&gt; www.digikey.com&lt;/a&gt; which has a large selection and a great interface.&amp;nbsp; Basically, type your part name prefix in (like ATTINY, or ATTINY13).&amp;nbsp; You should see a product selector.&amp;nbsp; Click "in stock" and then refresh.&amp;nbsp; Then head over to the "price" column (far right), click on the triangles, and enter ascending sort with 10 units (never buy just one or 2, if you do Murphy's law guarantees you'll burn them out!)&amp;nbsp; Personally, I find that digikey has the best prices on average, but other suppliers sometimes sell particular parts for significantly cheaper.&lt;br /&gt;&lt;br /&gt;Once you've picked out your part, pop up the datasheet just to make sure the parametric table was correct and to verify that it is "in-system programmable" -- or ICSP (in-circuit-serial-programming).&amp;nbsp; I think all AVRs have this feature but you never know...&amp;nbsp; Its also good if they have an internal oscillator so you don't have to hook up a crystal.&amp;nbsp; Besides it will be nerd-enhancing for you to actually read (skim) the datasheet; you'll learn valuable data mining skills :-).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Other Stuff&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you bought a thru-hole version, you'll want a breadboard to solder it on to (or use a solderless breadboard).&amp;nbsp; If you bought a SMT chip (congrats!), you'll need to either buy or &lt;a href="http://www.blogger.com/goog_224050078"&gt;make&lt;/a&gt;&lt;a href="http://effluviaofascatteredmind.blogspot.com/2012/01/diy-pcb-fabrication-breakout-board.html"&gt; a break-out board&lt;/a&gt; and to learn how to &lt;a href="http://effluviaofascatteredmind.blogspot.com/2011/09/diy-surface-mount-workshop.html"&gt;bake surface mount parts. &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next, you need a device programmer.&amp;nbsp; You can actually use your Arduino as described here &lt;a href="http://arduino.cc/en/Tutorial/ArduinoISP"&gt;http://arduino.cc/en/Tutorial/ArduinoISP&lt;/a&gt;, or buy a standalone one like the one I use: &lt;a href="http://www.ladyada.net/make/usbtinyisp/"&gt;http://www.ladyada.net/make/usbtinyisp/&lt;/a&gt;.&amp;nbsp; You'll also want the standard electronics stuff; a bunch of jumper wires, a soldering iron, a multimeter.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, it will take a few days for the stuff to arrive... when it does we will hook up the chip, write a simple program and upload it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Using The Chips&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok, everything arrived?&amp;nbsp; Next let's hook it up!&lt;br /&gt;&lt;br /&gt;The first step is to mount the chip into a solderless (or soldered) breadboard.&amp;nbsp; If you bought a SMT chip, you'll have to first bake it onto a breakout board.&lt;br /&gt;&lt;br /&gt;Next, take a look at the datasheet of your chip.&amp;nbsp; Right at the top of AVR datasheets you'll see a section called "Pin Configuration" that shows the physical layout of the chips.&amp;nbsp; Here is what the ATMEGA 328/168/88/48 PDIP package looks like: &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-kmQWKIO4JtI/TylW3j5MMFI/AAAAAAAAAcY/wFzrx1PmvUE/s1600/pinout.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="242" src="http://4.bp.blogspot.com/-kmQWKIO4JtI/TylW3j5MMFI/AAAAAAAAAcY/wFzrx1PmvUE/s400/pinout.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;And the ATTINY13:&lt;br /&gt; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-JSqHXU0Nm5Q/TylcDhgyA8I/AAAAAAAAAcg/oX01OUn5Zlw/s1600/pinout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="77" src="http://2.bp.blogspot.com/-JSqHXU0Nm5Q/TylcDhgyA8I/AAAAAAAAAcg/oX01OUn5Zlw/s320/pinout.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;And finally the ATTINY24:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-KelBlVo0bXc/TyleSG7FtlI/AAAAAAAAAco/FXnniZ8DBGg/s1600/pinout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="102" src="http://2.bp.blogspot.com/-KelBlVo0bXc/TyleSG7FtlI/AAAAAAAAAco/FXnniZ8DBGg/s400/pinout.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;On all chips, we have power and ground (yellow), reset (orange) and a SPI programming interface (red).&amp;nbsp; When the chip is in reset, the SPI interface can be used to upload programs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now take a look at the Arduino ICSP header:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-LY-d26Ay3AY/TylgWatW7xI/AAAAAAAAAc4/Zm0VIu7LHCo/s1600/icsp_pinout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="246" src="http://2.bp.blogspot.com/-LY-d26Ay3AY/TylgWatW7xI/AAAAAAAAAc4/Zm0VIu7LHCo/s320/icsp_pinout.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;This is what the 6 pins look like coming into the Arduino's ICSP port.&amp;nbsp; Your programmer should have the equivalent pins (but see caveat below).&amp;nbsp; These are the same pins located on each of the chips.&amp;nbsp; So, hook 'em up (connect the same named pin together)!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Some caveats: If you are using the ArduinoISP project to program your chip, don't hook the "reset" lines together.&amp;nbsp; The "reset" in the Arduino's ICSP header will reset the Arduino.&amp;nbsp; You want to hook a general purpose IO to the chip's reset so that the ArduinoISP can put it into reset.&amp;nbsp; For more details: &lt;a href="http://arduino.cc/en/Tutorial/ArduinoISP"&gt;http://arduino.cc/en/Tutorial/ArduinoISP&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The ICSP header is symmetrical, (and the "top" view vs the "bottom" view will mirror the pins) so if you can't tell where pin 1 is, use a multimeter to look for the 5 volt difference across the power and ground pins (2 &amp;amp; 6).&amp;nbsp; That way you can be sure you've found the correct orientation!&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-6qt2XgSci0g/TylkeSlGVLI/AAAAAAAAAdA/api2gNU7nMU/s1600/usbtiny_mega48.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-6qt2XgSci0g/TylkeSlGVLI/AAAAAAAAAdA/api2gNU7nMU/s400/usbtiny_mega48.jpg" width="225" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, so here I've hooked my USBtinyISP up to a MEGA48.&amp;nbsp; I've also added a resistor and LED in series connecting to one of the pins so I can try the "hello world" of embedded programming -- blinking a LED.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This might be hard to make out, because I can't focus on both the programming header and the chip... its just the foreground center chip, and connections, the other stuff is just that -- other stuff :-).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, next step is to use avrdude to verify that we can talk to the chip!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-545795048458341127?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/545795048458341127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/transdescending-arduino-going-cheap-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/545795048458341127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/545795048458341127'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/transdescending-arduino-going-cheap-and.html' title='Transdescending Arduino: Going cheap and small'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-kmQWKIO4JtI/TylW3j5MMFI/AAAAAAAAAcY/wFzrx1PmvUE/s72-c/pinout.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-503403682093716404</id><published>2012-01-20T18:38:00.000-08:00</published><updated>2012-01-31T10:21:56.824-08:00</updated><title type='text'>DIY PCB SMT Breakout board fabrication: Results</title><content type='html'>In the last posting I described how I made a few PCBs to act as SMT breakouts.&amp;nbsp; I've discovered that this seems to be a pretty ideal job for DIY PCB work!&amp;nbsp; To mount thru-hole stuff, you need the hole -- and that means hand drilling... but a small breakout board can be done on a single side, and its possible to use .1" Right Angle headers soldered onto an oval thru-hole pad so you don't even need to drill the hole for the breakout header.&lt;br /&gt;&lt;br /&gt;In my last posting I finished with the circuit board ironed onto the blank PCB.&amp;nbsp; It turns out that the final steps are quite easy.&amp;nbsp; First you get some etchant.&amp;nbsp; I used ferric chloride from Radio Shack, but I wish I had used &lt;a href="http://www.instructables.com/id/Stop-using-Ferric-Chloride-etchant%21--A-better-etc/"&gt;muriatic acid and hydrogen peroxide&lt;/a&gt; as it seems slightly better for the environment.&amp;nbsp; I poured the etchant in a leftover food container (now forever dedicated to PCB etching) and left the boards in for about 30 minutes.&amp;nbsp; I used a twisted wire hanger to keep my fingers out of the etchant:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-XHtaEFDMkfU/TxocoNBLRmI/AAAAAAAAAbA/pW4MmWGG5oQ/s1600/2012-01-14_09-57-49_525.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="180" src="http://2.bp.blogspot.com/-XHtaEFDMkfU/TxocoNBLRmI/AAAAAAAAAbA/pW4MmWGG5oQ/s320/2012-01-14_09-57-49_525.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Then rinse the board in lots of water, and leave the tap running to dilute any drips of etchant solution that go down your drain. &amp;nbsp; When you're done, put the top on the container (make sure it seals!) and store for next time.&lt;br /&gt;&lt;br /&gt;To remove the laser printer toner, I tried a few paint removers, liquid sanders, etc.&amp;nbsp; Nothing really worked.&amp;nbsp; It turns out that Acetone (nail polish remover) is required.&amp;nbsp; Its available in the paint section of hardware stores, and is absolutely amazing at the job. 2 swipes with a rag daubed in Acetone cleans the toner like wiping milk off a table!&lt;br /&gt;&lt;br /&gt;Next I soldered the parts on to the PCBs using a toaster oven.&amp;nbsp; I was concerned that the lack of a solder mask might make the solder bridge across PCB pads because its impossible to keep the solder paste onto pads.&amp;nbsp; In fact, I don't even bother, I just paint a thin line down across all the pads in a row (see my earlier post on &lt;a href="http://effluviaofascatteredmind.blogspot.com/2011/09/diy-surface-mount-workshop.html"&gt;DIY SMT soldering techniques here&lt;/a&gt;).&amp;nbsp; But in fact, the solder balled up nicely as you can see here:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-zeeh69e4kk0/Txocx1QDofI/AAAAAAAAAbI/Is7QloApWzs/s1600/DIY_PCB_with_chips.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" src="http://2.bp.blogspot.com/-zeeh69e4kk0/Txocx1QDofI/AAAAAAAAAbI/Is7QloApWzs/s640/DIY_PCB_with_chips.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;These are tiny SOIC-8 and SOT-23/5 parts.&amp;nbsp; I left the chip off the rightmost SOT-23/5 to see how well the solder wicked onto the pads.&amp;nbsp; Before putting it in the oven, the space between all the pads was completely covered with solder paste -- the wicking works great!&lt;br /&gt;&lt;br /&gt;I cut some of these boards with a hobbiest bandsaw, like you can get for $200 at Home Depot.&amp;nbsp; But its even easier to cut them by scoring the front an back with a ruler and then breaking them against the edge of&amp;nbsp; table (preferably metal).&amp;nbsp; Place something hard (like a metal or hardwood block) on top, grab the protruding board with pliers and then crack it by rotating the pliers downwards quickly.&lt;br /&gt;&lt;br /&gt;One surprise was how fine a pitch may be possible.&amp;nbsp; I had originally "designed" this board for professional fabrication and I accidentally left some tiny lettering on the board.&amp;nbsp; Amazingly, it transferred to the PCB perfectly well!&amp;nbsp; Here is a close up:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-LjdD_3Cji1A/Txoc_Qgw_8I/AAAAAAAAAbQ/e3y3fofU0GU/s1600/DIY_pcb_fine.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="348" src="http://1.bp.blogspot.com/-LjdD_3Cji1A/Txoc_Qgw_8I/AAAAAAAAAbQ/e3y3fofU0GU/s640/DIY_pcb_fine.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As you can see, by the ballpoint pen I put in for scale, the height of these letters is less then one millimeter!&amp;nbsp; I will need to go back to the file to check, but I'll bet that the line width is just a few mils (thousandths of an inch) wide.&amp;nbsp; Many professional PCB houses won't do less then 8mils!&amp;nbsp; Of course, they require repeatability across hundreds of large boards -- my goal is to get a single small breakout board out of a panel with a half dozen attempts.&lt;br /&gt;&lt;br /&gt;So basically, if the transfer works without smudging or distortion you can get amazingly fine detail.&amp;nbsp; And from my limited experience it does tend to do so reliably across portions of the board that can be 2 square inches in size.&amp;nbsp; This makes me believe that it may be possible to home fabricate chip-scale BGA breakout boards -- at least for small BGA packages.&amp;nbsp; I have not discovered anyone who has tried it yet; so I think that will be my next experiment (as soon as I find a "fun" BGA chip)!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EDIT:&amp;nbsp; Here's a photo of the SOIC8 installed on a PCB.&amp;nbsp; I think that its better to put all the pins in a single row, rather then the DIP configuration because that gives you the other side of the breakout board to use to make your circuit!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-TMc9Dm77Otc/Tx9FymS1yFI/AAAAAAAAAbs/gJv7Ioi615I/s1600/soic8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="208" src="http://2.bp.blogspot.com/-TMc9Dm77Otc/Tx9FymS1yFI/AAAAAAAAAbs/gJv7Ioi615I/s400/soic8.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Also note that no drilling is needed!&amp;nbsp; Get &lt;a href="http://search.digikey.com/us/en/products/9-103323-0/A32705-40-ND/1044432"&gt;right angle breakaway headers&lt;/a&gt; and then solder them to the (undrilled) thru hole pad.&lt;br /&gt;&lt;br /&gt;EDIT 2:&amp;nbsp; Here is a photo of a SOT-363 chip with a 2 mil circle indicating pin 1.&amp;nbsp; To get an idea of the size, the circle is indicated by the lead of a standard 1/4 watt resistor. As you can see the 2 mil line width was etched perfectly!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-b1vSVkcFhvk/Tygwyki2QlI/AAAAAAAAAcI/n3r9vYVU6gw/s1600/sot363.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="308" src="http://3.bp.blogspot.com/-b1vSVkcFhvk/Tygwyki2QlI/AAAAAAAAAcI/n3r9vYVU6gw/s400/sot363.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-503403682093716404?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/503403682093716404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/diy-pcb-smt-breakout-board-fabrication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/503403682093716404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/503403682093716404'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/diy-pcb-smt-breakout-board-fabrication.html' title='DIY PCB SMT Breakout board fabrication: Results'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-XHtaEFDMkfU/TxocoNBLRmI/AAAAAAAAAbA/pW4MmWGG5oQ/s72-c/2012-01-14_09-57-49_525.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-6509754989477642224</id><published>2012-01-13T18:47:00.000-08:00</published><updated>2012-01-13T18:59:47.807-08:00</updated><title type='text'>DIY PCB fabrication; Breakout Board Toner Transfer Experiments</title><content type='html'>Using modern components in PCB circuit board design essentially requires the use of small surface mount packages.&amp;nbsp; Testing these components can be costly and time consuming if you need to have a break-out-board professionally fabricated for every component. &amp;nbsp;&amp;nbsp; It is possible to hand-solder extremely thin &lt;a href="https://www.google.com/search?q=magnet+wire"&gt;magnet wire&lt;/a&gt; to individual leads of a SMT package but that is a very painstaking process.&lt;br /&gt;&lt;br /&gt;It would be much easier if individual PCBs could be hand-fabricated for the task.&amp;nbsp; I dug around on the web and DIY PCB fabrication for very small parts seems quite tricky; most people use home PCBs to make larger circuits out of thru-hole parts.&lt;br /&gt;&lt;br /&gt;However, even if multi-chip SMT designs are not feasible, it would be very valuable to be able to rapidly fabricate single chip breakout boards for SMT parts (for noobies: a breakout board is a PCB that simply brings all the pins in a SMT chip to a male header that can be plugged into a solderless breadboard).&amp;nbsp; Especially small parts; if you are putting a TQFP-144 on you board there are places where you can buy breakouts.&amp;nbsp; And there are fewer footprints so you could build up a "library" of breakouts.&amp;nbsp; But there are tons of different packages for components ranging from 2 to 32 pins!&lt;br /&gt;&lt;br /&gt;Making these small-pin count PCBs might be feasible (where large SMT designs are not) for several reasons.&amp;nbsp; First, the PCB will be quite small, allowing you to panel multiples "tries" onto a single DIY board.&amp;nbsp; You only need one success!&amp;nbsp; Second, the routing will be pretty short and simple.&amp;nbsp; If the pins are placed on either side of the chip the routes will be short and on a single side (so you can try the same circuit on both sides!).&amp;nbsp; Finally, I think that right angle .1" headers could be used in place of straight pins, so the final board would not need to be drilled.&amp;nbsp; This will save a lot of time (and painstaking work).&lt;br /&gt;&lt;br /&gt;Here are my first attempts (ever) to use the toner transfer method to put a mask on copper PCBs.&amp;nbsp; I panelized 6 SOIC-8 and 6 SOT-23/5 breakout boards onto a space about 2x3 inches:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kZO17nLO3bw/TxDh3kymJBI/AAAAAAAAAZ4/ZH6M9kUmTbc/s1600/2012-01-13_19-49-33_578.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="360" src="http://3.bp.blogspot.com/-kZO17nLO3bw/TxDh3kymJBI/AAAAAAAAAZ4/ZH6M9kUmTbc/s640/2012-01-13_19-49-33_578.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the back side attempts:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3ZTGTW_qRPo/TxDiAVXOFgI/AAAAAAAAAaA/sKNgA8zMVsk/s1600/2012-01-13_19-50-37_595.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="360" src="http://3.bp.blogspot.com/-3ZTGTW_qRPo/TxDiAVXOFgI/AAAAAAAAAaA/sKNgA8zMVsk/s640/2012-01-13_19-50-37_595.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The basic methodology (for people who are reading this as an instructable) is to:&lt;br /&gt;1. Remove all layers of your PCB except routes, pads and vias.&amp;nbsp; Export it as an image (monochrome, 600 dpi).&amp;nbsp; Load it up in a graphics editor (gimp), reverse the color, and horizontally mirror it.&lt;br /&gt;&lt;br /&gt;2. Next, use a laser printer to print it onto some kind of paper.&amp;nbsp; You want a paper with unique, generally undesirable properties; essentially the toner should just barely stick and it should dissolve readily in water.&amp;nbsp; Four types are commonly suggested:&lt;br /&gt;&amp;nbsp; A) glossy paper ripped from a cheap magazine/catalog&lt;br /&gt;&amp;nbsp; B) glossy photo paper&lt;br /&gt;&amp;nbsp; C) sticker backing paper (pull the stickers off and print on the shiny side)&lt;br /&gt;&amp;nbsp; D) speciality PCB toner transfer paper.&lt;br /&gt;&lt;br /&gt;3. "clean" a blank PCB with steel wool, and then iron the toner on by placing the iron at its highest setting on the paper (which is on the PCB) for about a minute.&amp;nbsp; You can't move the paper relative to the PCB so some masking tape on the corners might help.&amp;nbsp; Also don't push down hard, and don't move the iron around much.&lt;br /&gt;&lt;br /&gt;4. Soak the PCB in water for about 5 minutes and then rub the paper off.&amp;nbsp; You can rub quite hard; if it toner comes off then it did not transfer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The PCB on the upper left of image 1 was made with glossy photo paper.&amp;nbsp; This paper essentially did not work for me; it would glue itself to the iron and then separate from the PCB or pick it up as well.&amp;nbsp; The toner was still melted at this point so most of it stayed with the paper.&lt;br /&gt;&lt;br /&gt;The upper right image 1 board shows what happens when you push down too hard.&amp;nbsp; Pressure on the melted toner caused it to spread out.&amp;nbsp; So don't do that!! :-)&amp;nbsp; The bottom left of image 1 was ironed on for several minutes.&amp;nbsp; It got so hot it changed the copper color -- additionally the paper was extremely hard to remove.&amp;nbsp; Oops!&amp;nbsp; The last photo on image 1 was again done with glossy photo paper.&amp;nbsp; The paper still lifted off with the iron but amazingly it left a perfect transfer in the middle!&amp;nbsp; Unfortunately I doubt its repeatable.&lt;br /&gt;&lt;br /&gt;I left board on photo 2 clean to show how the PCB should look after it has been rubbed by the steel wool. &amp;nbsp; The other 3 boards on the bottom image show transfers with the sticker-backing paper with ironing times of 30seconds, 1 minute, and 1:30.&amp;nbsp; I'm sure you can see which is which since they show more toner sticking.&amp;nbsp; In fact, the last image has perfect transfers of 9 out of the 12 circuits!&amp;nbsp; The only miss transfers are on the top of the PCB.&amp;nbsp; Clearly I did not get that portion hot enough (in fact, I think that it may have been under the steam holes of the iron).&amp;nbsp; Removal of the paper was pretty quick under hot water; about 5 minutes (so clearly the boards were not under the iron for too long).&amp;nbsp; But the paper did not "pill" up like other web postings suggest; it mostly peeled off.&amp;nbsp; After ironing, the paper it was a little browned in spots but not significantly.&lt;br /&gt;&lt;br /&gt;Like any other craft there is clearly a bit of skill and practice required.&amp;nbsp; And some experimentation is required to become familiar with your particular tools.&amp;nbsp; However, so far this looks like a pretty feasible method for breakout board fabrication.&amp;nbsp; In the next installment I will attempt to etch the boards and solder the parts on! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-6509754989477642224?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/6509754989477642224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/diy-pcb-fabrication-breakout-board.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6509754989477642224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6509754989477642224'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/diy-pcb-fabrication-breakout-board.html' title='DIY PCB fabrication; Breakout Board Toner Transfer Experiments'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-kZO17nLO3bw/TxDh3kymJBI/AAAAAAAAAZ4/ZH6M9kUmTbc/s72-c/2012-01-13_19-49-33_578.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-4233580449471365195</id><published>2012-01-10T06:48:00.000-08:00</published><updated>2012-01-30T08:48:55.472-08:00</updated><title type='text'>Ubuntu 11.10 64bit CadSoft Eagle 6.0.0 installation pain</title><content type='html'>I think Eagle 6 was rushed to market :-).&amp;nbsp; It resists installation on the most popular Linux distros, and when you do finally get it working it pops up with an "I'm sorry, there's a nasty bug" dialog.&amp;nbsp; But Kudos to Cadsoft for admitting it!!!&lt;br /&gt;&lt;br /&gt;Here are my notes on the installation.&amp;nbsp; I think I might be missing a step or two so if you follow these and run into issues, please post a comment!!!&lt;br /&gt;&lt;br /&gt;These instructions should also mostly work in 32 bit Linux distros, but you won't need to install as much (remove the packages with "i386", or "32" in their names).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1: Prep Ubuntu for 32 bit compilation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo apt-get install build-essential lib32z1-dev g++-multilib gcc-multilib ia32-libs libssl1.0.0 libssl1.0.0:i386 libjpeg8 libjpeg8:i386&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Next, get and install libpng14 from source:&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;http://sourceforge.net/projects/libpng/files/libpng14/1.4.8/libpng-1.4.8.tar.xz/download&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;tar xvf libpng-1.4.8*&lt;br /&gt;cd libpng-*&lt;br /&gt;./configure CFLAGS=-m32 --prefix=/&lt;br /&gt;make check&lt;br /&gt;sudo make install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;32 bit distros should remove "CFLAGS=-m32" and just use this line instead:&lt;br /&gt;./configure&amp;nbsp; --prefix=/&lt;br /&gt;&lt;br /&gt;&lt;b&gt;[Troubleshooting]&lt;/b&gt; If you get the error: "configure: error: C compiler cannot create executables" check the config.log file.&amp;nbsp; If the problem is: "/usr/bin/ld: cannot find crt1.o: No such file or directory" then you did not install g++-multilib gcc-multilib.&lt;br /&gt;&lt;br /&gt;If you get:&amp;nbsp; "configure: error: zlib not installed" you did not install lib32z1-dev&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Now install Eagle:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;chmod a+x eagle-lin*&lt;br /&gt;sudo ./eagle-lin*&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Good Luck and keep building OSHW!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-4233580449471365195?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/4233580449471365195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/ubuntu-1110-64bit-cadsoft-eagle-600.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/4233580449471365195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/4233580449471365195'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2012/01/ubuntu-1110-64bit-cadsoft-eagle-600.html' title='Ubuntu 11.10 64bit CadSoft Eagle 6.0.0 installation pain'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-5771831984423997032</id><published>2011-11-02T17:18:00.000-07:00</published><updated>2011-11-02T17:18:56.631-07:00</updated><title type='text'>Open Hardware Journal</title><content type='html'>&lt;a href="http://perens.com/about/bio/"&gt;Bruce Perens&lt;/a&gt; (who did &lt;a href="http://busybox.net/"&gt;Busybox&lt;/a&gt; and Debian as well as defining "Open Source") has created an Open Hardware Journal (&lt;a href="http://openhardware.org/journal/"&gt;http://openhardware.org/journal/&lt;/a&gt;).&amp;nbsp; Check out the first issue, I've got two articles in it!&amp;nbsp; Ok ok, probably he needed more submissions which is why my stuff made the cut :-).&amp;nbsp; But hey I'll take it!&lt;br /&gt;&lt;br /&gt;The first article "An Open Hardware Platform for USB Firmware Updates and&lt;br /&gt;General USB Development" is about the USB interface on the Lightuino.&amp;nbsp; I chose that topic because this interface is a cheap and tiny way to put USB in many of your projects.&amp;nbsp; The interface will talk SPI to your uP or some SPI chip, or I2C (although I did not use that in the Lightuino).&amp;nbsp; And it will do serial (USB CDC ACM if you need the formal acronym) or emulate an input device (USB HID).&amp;nbsp; Read the article for more info, and check out my code on github here: &lt;a href="https://github.com/gandrewstone/toastedCypressUsb"&gt;https://github.com/gandrewstone/toastedCypressUsb&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My second article "A Return To Open Devices" is about my ideas around the philosophy and driving forces behind the open hardware movement.&amp;nbsp; I'm sure the people who come to open hardware do it for many different reasons; this is simply my perspective.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-5771831984423997032?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/5771831984423997032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2011/11/open-hardware-journal.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5771831984423997032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5771831984423997032'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2011/11/open-hardware-journal.html' title='Open Hardware Journal'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-6209361290496825245</id><published>2011-09-09T15:46:00.000-07:00</published><updated>2011-09-12T07:42:31.017-07:00</updated><title type='text'>DIY Surface Mount Workshop</title><content type='html'>&lt;br /&gt;&amp;nbsp;A few days ago I held a workshop on do-it-yourself (aka cheap) surface mount electronics techniques at a Boston artspace/hackerspace called sprout &amp;amp; co (&lt;a href="http://thesprouts.org/"&gt;http://thesprouts.org/&lt;/a&gt;).&amp;nbsp; This was organized through the &lt;a href="http://www.meetup.com/The-Boston-Arduino-Users-Group/events/29968071/"&gt;Boston Arduino meetup group&lt;/a&gt;.&amp;nbsp; Participants got to mount a tiny QFN-24 chip (a &lt;a href="http://www.ti.com/product/pca9555"&gt;PCA9555 io-expander&lt;/a&gt;) onto a QFN breakout board and then we tested them by connecting them up to an Arduino.&amp;nbsp; There was one bad chip; but once that was replaced everybody's boards worked!&lt;br /&gt;&lt;br /&gt;Here are my notes from the workshop.&amp;nbsp; If you did not attend, these notes are a good tutorial on how to get started cheaply!&amp;nbsp; Also, if you'd like some of the QFN breakout boards, please contact me and I will sell you a few.&lt;br /&gt;&amp;nbsp;				&lt;style type="text/css"&gt;p { margin-bottom: 0.08in; }h1 { margin-bottom: 0.08in; }h1.western { font-family: "Arial",sans-serif; font-size: 16pt; }h1.cjk { font-family: "DejaVu Sans"; font-size: 16pt; }h1.ctl { font-family: "DejaVu Sans"; font-size: 16pt; }h2 { margin-bottom: 0.08in; }h2.western { font-family: "Arial",sans-serif; font-size: 14pt; font-style: italic; }h2.cjk { font-size: 14pt; font-style: italic; }h2.ctl { font-size: 14pt; font-style: italic; }&lt;/style&gt;&lt;br /&gt;&lt;h2 class="western"&gt;&lt;span style="font-size: large;"&gt;Surface Mount Tools (homemade/modified):&lt;/span&gt;&lt;/h2&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Toaster Oven:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; Got mine from the dump. Keep it simple; you don'tneed to mod it with fancy temperature feedback like some web posts suggest. &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Hot air “pencil”:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-bMj3HJlQZCE/TmrTuqMkVtI/AAAAAAAAAXY/ih3Rb2e2Hs4/s1600/homemade_hot_air_pencil_from_heat_gun.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-bMj3HJlQZCE/TmrTuqMkVtI/AAAAAAAAAXY/ih3Rb2e2Hs4/s320/homemade_hot_air_pencil_from_heat_gun.jpg" width="240" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;$30 used heatgun (ebay) with aluminum foil to narrow and speed the air jet.&amp;nbsp; Secure the aluminum foil by wrapping steel wire around the nozzle.&amp;nbsp; Shape the hole in the end by forming it around a pen with your fingers.&amp;nbsp; This tool is indispensable for removing and replacing chips (rework), and works great!&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Cheap plastic Mechanical Pencil:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; Pencil lead solder paste onto pins;eraser dabs off too much.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;PCB Vice:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; You can use any &lt;a href="http://www.homedepot.com/h_d1/N-5yc1v/R-100011109/h_d2/ProductDisplay?langId=-1&amp;amp;storeId=10051&amp;amp;catalogId=10053"&gt;clamp like this&lt;/a&gt;.&amp;nbsp; You can probably get one for less then $10 if you look around.&amp;nbsp; Just drill a hole in your desk slightly smaller then the clamp bar and stick it in upside down.&lt;br /&gt;Here it is holding the boards we made, with my breadboard-to-IDE-or-RJ-45 connector in the background. &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-p8Ex9mk7GgY/TmrUIvTfOjI/AAAAAAAAAXc/J1Sf7jzNEhg/s1600/cheapvise.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/-p8Ex9mk7GgY/TmrUIvTfOjI/AAAAAAAAAXc/J1Sf7jzNEhg/s320/cheapvise.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; But once you do this fairly often you'll want to upgrade to a &lt;a href="http://www.adafruit.com/products/151"&gt;Panavise&lt;/a&gt;.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Soldering Iron:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; You CAN use a standard cheapo wide tip soldering iron for SMT rework -- even though you can't touch just a single pin, it is sufficient to heat a single pin.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; However, knockoffs of the "Hakko 936" soldering iron are pretty cheap at $50; check &lt;a href="http://www.amazon.com/Aoyue-Soldering-System-Bonus-Iron/dp/B001RNG2PG"&gt;Amazon&lt;/a&gt; or ebay.&amp;nbsp; And they are all you'll ever need...&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Tweezers:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; You use these to hand "pick-and-place" chips.&amp;nbsp;&amp;nbsp; Buy them from a drugstore.&amp;nbsp; But don't buy the cheapest pair you can find.&amp;nbsp; Buy a set that looks totally overkill for plucking nose hairs :-) -- &lt;a href="http://www.walgreens.com/store/c/revlon-point-tip-ultimate-tweezer/ID=prod1354630-product"&gt;like they were milled out of a block of metal&lt;/a&gt;.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-FvuAMERJonQ/TmqFZBVeT5I/AAAAAAAAAXA/OCC5679pYu8/s1600/tweezers.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-FvuAMERJonQ/TmqFZBVeT5I/AAAAAAAAAXA/OCC5679pYu8/s320/tweezers.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Magnifying glass/bright light:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; You may need these to peek at the board as it is cooking, and for rework. I'm sure you can do it on the cheap. I have a "helping hands" for the glass:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-edP7bUKYr5Q/TmqGbrnX_GI/AAAAAAAAAXE/76WG_XpvwRM/s1600/helpinghands.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-edP7bUKYr5Q/TmqGbrnX_GI/AAAAAAAAAXE/76WG_XpvwRM/s1600/helpinghands.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; Available on &lt;a href="http://www.ebay.com/sch/i.html?_nkw=helping+hands"&gt;ebay&lt;/a&gt; for 6 bucks.&amp;nbsp; And the clips are actually great for other soldering jobs, like joining 2 wires. &amp;nbsp; For the bright light, any portable (plug in) work light will work fine (try home depot).&amp;nbsp; Once you do a lot of work you may want a "swing arm magnifying glass lamp":&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-PWX1MgXmVV8/TmqHSBpeX1I/AAAAAAAAAXI/ttJoTKrFK8c/s1600/swingarmmagnifier.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-PWX1MgXmVV8/TmqHSBpeX1I/AAAAAAAAAXI/ttJoTKrFK8c/s1600/swingarmmagnifier.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Supplies:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Solder wire:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; Get thin rosin core solder&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Solder Paste:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; Solder paste are tiny balls of solder in a flux mix that is viscous like toothpaste.&amp;nbsp; It can be very expensive and require refrigeration.&amp;nbsp; Don't buy that.&amp;nbsp; Buy this &lt;a href="http://www.dealextreme.com/p/lodestar-soldering-paste-50g-4711"&gt;Lodestar paste from DealExtreme&lt;/a&gt;.&amp;nbsp; It does not require refrigeration, however, as a hobbyist you should refrigerate it so it will last you forever.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Flux:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; Flux is a substance that cleans your PCB and lets the solder flow better.&amp;nbsp; It is also available at DealExtreme.&amp;nbsp; They often mis-name it "paste" but you'll know it is flux only because it won't be grey.&amp;nbsp; Get "no-clean" or "neutral PH"&amp;nbsp; (its almost all like that now).&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;b&gt;Solder Remover Braid:&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; This braid is necessary to remove excess solder when doing fine SMT work.&amp;nbsp; Solder suckers don't work!&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-6Y2cafYZ_Rc/TmrUzCOcBfI/AAAAAAAAAXg/s-KyopfXpE0/s1600/desoldering_braid.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/-6Y2cafYZ_Rc/TmrUzCOcBfI/AAAAAAAAAXg/s-KyopfXpE0/s320/desoldering_braid.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class="western"&gt;&lt;span style="font-size: large;"&gt;Step 1:&lt;/span&gt;&lt;/h2&gt;&lt;h2 class="western"&gt;&lt;span style="font-size: small;"&gt;Use an oven to solder a QFN-24 part onto abreakout board.&lt;/span&gt;&lt;/h2&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Mix a TINY bit of solder paste and flux to about a 60/40 mix.&amp;nbsp; You don't need much.&amp;nbsp; Put any extra back into the container since it contains lead so its good to generate as little hazardous waste as possible...&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;Too much paste and the solder willnot wick onto the pads (it will stay on the non-metal parts of the PCB or create bridges between pads -- "pads" are the metal parts of the PCB that you are trying to solder the chip's wires "pins" to)&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;Too much flux and the pins won't besoldered.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Apply with your mechanical pencil (click out the lead).&amp;nbsp;  Fortiny QFN leads, just draw your pencil straight across all the leads.&amp;nbsp; That is, cover the entire surface including between theleads.&amp;nbsp; This is important so let me emphasize: Don't try to keep the paste out of the 6mil space between the leads!&amp;nbsp; That is impossible &amp;amp; when heated the flux will cause the paste to flow to the pads anyway.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;But if there is a center square pad, use the pencil todraw around that pad to clean any paste that would bridge the center pad to a lead (it isvery hard to fix that issue).&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;You need to apply a thin layer.&amp;nbsp; You should be able to see the shape of the pads under the paste, but they should be obscured.&amp;nbsp; But if the paste goes on clear, with just a few "dirty" spots you have too much flux in your mix.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-YD45eCcGJ8k/Tm4ZhMIdCII/AAAAAAAAAXo/VDGBPsi-iTw/s1600/104_2854.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://4.bp.blogspot.com/-YD45eCcGJ8k/Tm4ZhMIdCII/AAAAAAAAAXo/VDGBPsi-iTw/s640/104_2854.JPG" width="480" /&gt;&lt;/a&gt;&lt;/div&gt;This photo shows 6 boards with solder paste on them -- this wasn't part of the workshop, I just grabbed this photo from my archives.&amp;nbsp; Perhaps the paste is on a little thick... but as you can see, no attempt was made to keep the paste away from the spaces between the pads.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Next, put the chip on with tweezers.&amp;nbsp; Positioning is not critical; you can be off by a half-pin in any direction.&amp;nbsp; When hot, the chip will actually float on the flux layer and surface tension will actually cause the chip to be sucked onto the pads!&amp;nbsp; But if you are off by more then a half-pin, the chip might be sucked onto the wrong set of pads.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Now bake your board.&amp;nbsp; You need to bake the board in a particular fashion, but its not rocket science.&amp;nbsp; &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&amp;nbsp; Here is an example provided by Kester paste.&amp;nbsp; It works fine for any paste: &lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;a href="http://3.bp.blogspot.com/-9BchIzgXgR8/TmqMAxIgprI/AAAAAAAAAXM/OcBP8xpYsKM/s1600/standard_profile.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="492" src="http://3.bp.blogspot.com/-9BchIzgXgR8/TmqMAxIgprI/AAAAAAAAAXM/OcBP8xpYsKM/s640/standard_profile.png" width="640" /&gt;&lt;/a&gt;Basically, you want to raise the board to 150C in a minute or two.&amp;nbsp; Then wait for another minute or two so the entire board gets to that heat.&amp;nbsp; This bakes out any water and lets everything expand (if you chip pops like a firecracker its ruined. &amp;nbsp; You have too much water in those chips and need to bake the rest at low heat for hours to evaporate it out; its only ever happened once to me).&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Next, you bring the heat up to a max of 220-240C rapidly to melt all the solder paste.&amp;nbsp; Excessive exposure to this heat can harm the chips or melt plastic parts so you want to keep this brief.&amp;nbsp; At this point, use your magnifying glass and a bright light to watch the paste on the board.&amp;nbsp; It will go from grey to bright shiny silver when melted (bubbling is just the flux moving around).&amp;nbsp; Wait 10 more seconds after you see no more grey to make sure solder you can't see also melts.&amp;nbsp; Then turn the oven off.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Now you have a choice.&amp;nbsp; You can either wait with the oven door closed so the oven cools down slowly (as shown on the heat profile).&amp;nbsp; Cooling slowly will mean there are fewer mechanical stresses on the board.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Or if you see any problems, you can open the oven door, pull out the tray andreposition “tombstone” (sticking up) resistors and caps.  Also if a chip is out of alignment (off by one pin for example), you can “tap”the chip to make it position itself!&amp;nbsp; When doing multiple bigger boards, you'll often find a few issues.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;I'd imagine that while this cools the board faster, it is probably still less stressful then heating a portion of the board with your "air pencil".&amp;nbsp; That is the only other way to reposition chips.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class="western"&gt;Debugging&lt;/h2&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Now that your board is baked and cooled, you need to visually inspect it.&amp;nbsp; Look for bridges (2 pins connected) and unsoldered pins.&amp;nbsp; A bridge will look more shiny then the other pins since it is a bigger solder blob.&amp;nbsp; Unsoldered pins will look darker.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Unsoldered:&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Apply a tiny bit of paste to solder pins.&amp;nbsp; Heat the pin (and perhaps nearby pins) with an iron to melt the solder.&amp;nbsp; Often you'll have added too much paste, so now check for bridges.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Bridges:&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Use flux to cause the bridge to flow onto nearby pads/pins.&amp;nbsp; This only works if the bridge is not caused by too much solder.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Use copper solder remover wire (braid) toremove solder.&amp;nbsp; I guess this is often misused.&amp;nbsp; This is how you do it:&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Touch braid to you can of flux to get a tiny bit on it)&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Put the braid onto the bridge part so it complete covers it (and probably a bunch more pins).&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;Heat the braid by using the iron to pressit into the bridge where you want to remove the solder.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;The braid won't work if its not hot!!! So heat it and cause its heat to melt the solder.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;If the braid is at all silver, clip it and throw that part away; it has already sucked up solder.&lt;/div&gt;&lt;div style="margin-bottom: 0in;"&gt;&lt;/div&gt;&lt;h2 class="western"&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2 class="western"&gt;Speed solder headers &lt;/h2&gt;&lt;br /&gt;Next we need to solder long headers onto the board.&amp;nbsp; There is a fast technique to do a row of pins that I will show.&amp;nbsp; Eventually you should be able to do about a pin per second or two.&lt;br /&gt;&lt;br /&gt;First, clip/break the pin header so it contains the right number of pins.&lt;br /&gt;Next put the headers in the solderless breadboard; and put the PCB on top.&amp;nbsp; This gets themaligned correctly.&amp;nbsp; Use the PCB to seat them into the breadboard.&amp;nbsp; This will keep the board steady as you solder it. &lt;br /&gt;&lt;br /&gt;Now its often good to solder the ends to make sure the PCB stays firmly seated against the pin header, but as you get better you can skip this step.&lt;br /&gt;&lt;br /&gt;Now use the speed solder technique to do the rest.&amp;nbsp; Here's a video:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/m6Emq-Ideqw/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/m6Emq-Ideqw?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266"  src="http://www.youtube.com/v/m6Emq-Ideqw?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;Here I am doing pins on both sides of the iron, so heating 6 pins simultaneously.&amp;nbsp; But you should stick with one side for now.&lt;br /&gt;&lt;br /&gt;Use an overhand grip on the iron so it can be placed flush along the pins.&lt;br /&gt;&lt;br /&gt;Heat 3 pins simultaneously.&lt;br /&gt;&lt;br /&gt;Preheat pin -- using iron tip&lt;br /&gt;Middle pin -- focus on soldering it&lt;br /&gt;3rd pin -- continue to heat to make a good solder joint&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I noticed most people using not nearly enough solder.&amp;nbsp; Feed the solder so fast that there is a large constant blob of solder on the iron.&amp;nbsp; This solder blob is essential to transfer heat to the pins.&amp;nbsp; As you push your iron across the pins it will actually clean up this excess solder (if not, your iron is too cold, or you aren't using rosin core solder).&amp;nbsp; Actually you may end up with a few bridges, but those are easy (and quick) to fix once the job is done.&amp;nbsp; Just hold a "dry" iron against the bridge and it should grab the excess.&amp;nbsp; And look for any holes you missed; as a beginner you'll have one or two! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2 class="western"&gt;Testing: Hook up the breakout board&lt;/h2&gt;&lt;br /&gt;Read &lt;a href="http://www.ti.com/lit/gpn/pca9555"&gt;the spec&lt;/a&gt; to hook up the board.&amp;nbsp; Really.&amp;nbsp; This is a great exercise and very important to get correct.&amp;nbsp; Because if you are trying a new PCB, new software, and a new chip you want to make sure you get something right! :-)&amp;nbsp; But ok, Ryan Feeney was kind enough to help you out with this image:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-TAVwobjT1i0/TmqUkU5XzUI/AAAAAAAAAXU/OPJbQtdgSus/s1600/PCA9555_breadboard.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-TAVwobjT1i0/TmqUkU5XzUI/AAAAAAAAAXU/OPJbQtdgSus/s320/PCA9555_breadboard.png" width="282" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In this image, GND are the blue rows on both sides and 5v are the red ones (connect them to GND and 5v on your Arduino). &lt;br /&gt;&lt;br /&gt;One other trick; if you don't have a handy 3.3v power supply, you can use a red LED to reduce 5v to 3.3v.&amp;nbsp; This will work up to about 20mA; beyond that your LED will burn out so use multiples!&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Testing: The sample sketch&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;The sketch I used is located at: &lt;a href="http://i2cdevices.svn.sourceforge.net/viewvc/i2cdevices/latest/ioexpander/pca9555/pca9555.pde?revision=1"&gt;http://i2cdevices.svn.sourceforge.net/viewvc/i2cdevices/latest/ioexpander/pca9555/pca9555.pde?revision=1&lt;/a&gt;&lt;br /&gt;Someday I might actually put other i2c devices in there too! :-)&lt;br /&gt;It should blink the LED.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-J47y9TQoWr4/TmrVHaKxzCI/AAAAAAAAAXk/Sj4PR4Om-Dk/s1600/test_jig.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/-J47y9TQoWr4/TmrVHaKxzCI/AAAAAAAAAXk/Sj4PR4Om-Dk/s320/test_jig.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 class="western"&gt;Hot air rework exercise&lt;/h2&gt;&lt;br /&gt;Some of you got to do or see this, because we had a dead chip.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this exercise we'll use the hot air "pencil" to remove a chip and then replace it with a new one.&lt;br /&gt;&lt;br /&gt;First, use aluminum foil and metal boxes to cover and protect other chips(and plastic headers).&amp;nbsp; Well, there is nothing really to protect in the breakout board except for the plastic vise jaws -- but for a "real" board you'll need this.&lt;br /&gt;&lt;br /&gt;Heat the chip with slow motions of the heat gun.&amp;nbsp; When the solder on the edges goes shiny, pluck/knock it off with tweezers.&lt;br /&gt;&lt;br /&gt;If there is a lot of solder on the pads then clean it with flux and solder remover.&amp;nbsp; Put a little more paste on the pads.&lt;br /&gt;Touch the new chip in the flux can to just get a TINY bit of flux on its pads&lt;br /&gt;&lt;br /&gt;Place the new chip right near, but not on, the pads.&amp;nbsp; This will cause the chip to heat up with the pads.&amp;nbsp; The chip's leads have to be hot enough to melt the solder or the solder won't stick to it!&amp;nbsp; Its the SMT equivalent of a "cold" solder joint.&lt;br /&gt;&lt;br /&gt;Reheat with the hot air "pencil".&amp;nbsp; When the solder melts (it goes shiny) it should wick to the pads so there is no bridges.&amp;nbsp; If there are bridges you have too much solder or not enough flux.&amp;nbsp; When it wicks correctly, tap the chip with tweezers to move it into place.&amp;nbsp; You should see it "snap" or "pop" into place as the surface tension of each pad/lead pulls the chip.&amp;nbsp; Heat for maybe 10 more seconds to make sure all the chip's leads were hot enough and then you are done!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&amp;nbsp; Please go forth and build open source hardware!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-6209361290496825245?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/6209361290496825245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2011/09/diy-surface-mount-workshop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6209361290496825245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6209361290496825245'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2011/09/diy-surface-mount-workshop.html' title='DIY Surface Mount Workshop'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-bMj3HJlQZCE/TmrTuqMkVtI/AAAAAAAAAXY/ih3Rb2e2Hs4/s72-c/homemade_hot_air_pencil_from_heat_gun.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-2811118646345536103</id><published>2011-06-16T17:49:00.000-07:00</published><updated>2011-06-16T19:40:31.707-07:00</updated><title type='text'>RSD GameMaker</title><content type='html'>Recreational Software Designs GameMaker product was a program that ran on the IBM PC machines around 1991-1995, sold in the USA, UK and Korea.  I recently became aware of some efforts by the community at diygamer, specifically Eric-Jon to gather information about the program.  He has written 20 or so posts about games that users created, see &lt;a href="http://www.diygamer.com/author/eric/"&gt;http://www.diygamer.com/author/eric/&lt;/a&gt;, and also created a wiki that attempts to capture the history about the community at&lt;br /&gt;&lt;a href="http://www.aderack.com/game-maker/index.php?title=Main_Page" target="_blank"&gt;http://www.aderack.com/game-&lt;wbr&gt;maker/index.php?title=Main_&lt;wbr&gt;Page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I was the creator and major author of the software, and was helped by my father who handled most business issues, my brother who also did some coding, and my mother who did GUI testing and made some games.  We also had a friend of my father who graciously spent a few weekends sitting with me giving guidance (Thanks Pete!)&lt;br /&gt;&lt;br /&gt;It was basically a toolkit that let you create your own platform-style (of course we did not call it that back then!) games.&lt;br /&gt;&lt;br /&gt;As the creator of a very small piece of history (but one that seems to have a major effect on those who used it well, spawning passions and careers around programming, graphics, and games -- Google "RSD GameMaker"), I shall indulge in a very small soapbox so you can hear my thoughts and ramblings on the subject :-).&lt;br /&gt;&lt;br /&gt;I think perhaps that in retrospect GameMaker's history may be interesting for a few reasons. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The first Game Creation Engine?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First of all, it obviously was the "diygamer" tool of that time, so it anticipated the thriving community we have today with countless game engines, web sites and indie game companies.  I hear that it was preceded by a game maker on the Commodore machine, but I had/still have no knowledge of that software.  As far as I knew, we were the first game engine in existence and we allowed games to be built with absolutely no programming (and ran up against the limitations that imposed as well)!  But in the interest of complete disclosure, I believe that at that time professional game companies were also buying game engines for major $ to aid in game development.  Very little information is available about these professional engines since at that time -- a time of game-feature "brinkmanship" -- the information was closely held.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Anticipating Creative Commons and the Remix Culture&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Second, we shipped the software with a bunch of sample games and encouraged users to borrow and reuse our content.  We also worked with a BBS owner (bulletin board system -- it was a precursor to the internet) to have an "official" community sharing repository.   Also, I deliberately (in fact I remember an argument about it) made no effort to protect a game's content -- anyone could load up anyone else's game in the editors.  My feeling was that if you were sophisticated enough to build a game that really needed protection, you could wrap it in your own encrypted .zip file or something.  This philosophy emerged from knowledge of shareware licenses, but AFAIK is probably the first adaptation of the philosophy for content, not code.  Today, the "&lt;a href="http://creativecommons.org/"&gt;creative commons&lt;/a&gt;" has standard licenses covering all manner of content.&lt;br /&gt;&lt;br /&gt;And a lot of people did reuse our stuff (and other game authors)!  In that way it anticipated today's emerging &lt;a href="http://en.wikipedia.org/wiki/Remix_culture"&gt;remix culture&lt;/a&gt;.  If I remember correctly (and I may not), I was the one who decided to share all of the content shipped on our CD and disks while my father should receive credit for encouraging the community, through user letters (yes back then we got HANDWRITTEN letters, I still have a huge stack of them), the community BBS, and the GameMaker Exchange (which was sort of a "mail us your game &amp;amp; we'll mail it to other people" thing).  But of course as a family company these decisions were often made around the dinner table.  We also decided to buy (and beg) some games from our best users and ship them with the 3.0 version of our product in a "remixable" license.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Teen Hackers!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Third it was really a major piece of software built by teenagers, mostly for teenagers.  This probably makes it pretty unique, if not completely unique.  It consisted of 16000 lines of "c" code, 2000 lines of hard core x86 assembler, and 1000 lines of C++ (versions 1 &amp;amp; 2 predated the emergence of C++).  So about 20000 lines of code total.  'Sloccount' (a Linux software line counting program) puts this at 4.5 man-years of effort with a $600000 price tag (assuming developer salary $50k 2010 dollars).  But we did it during high school and college.&lt;br /&gt;&lt;br /&gt;Sure we had adult supervision (and funding and support -- I can't overemphasise how supportive my parents were!!!), but at the same time we wrote all the code and essentially came up with the content entirely ourselves (with our user's input of course).  If GameMaker somehow fast-forwarded itself to 2010, it likely would have been entirely teenager-driven.  However, in the internetless world of the '90's there were countless costs -- lots of expensive advertising, CDs to print (sorry no CD burners), boxes and user manuals made, mailers, and on and on.  I remain amazed that my parents put that kind of cash at risk for this effort.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Breathing Life into the DIY Culture&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;GameMaker was part of the DIY and programming culture of the 90's.  I would love to see what my users are doing now.  You have to be a certain kind of person to look through a magazine full of ads for instant-gratification twitch games and pick the software that makes you WORK hard.  I would guess that we managed to pre-select the most creative individuals; a feat that our educational system has a very hard time doing.&lt;br /&gt;&lt;br /&gt;Also I think that it is probably possible to trace a certain (changing) subset of the population throughout US history.  Call them tinkerers, creative minds -- just people who like to do their own thing.  And I am proud to have been an enabler of this culture in the 90's.&lt;br /&gt;&lt;br /&gt;I see it in automobiles and phone systems in the 50s and 60s to the transistor (hi-fi) radio kits (hobbiest electronics), to the early garage build-your-own computers of the mid-70s and early 80s, the software of the mid-80s to mid-90s, all the web software, blogging etc from the mid-90s to sometime in the 2000s, and finally the emerging custom open-source hardware culture of the 2010s (&lt;a href="http://www.arduino.cc"&gt;www.arduino.cc&lt;/a&gt;, &lt;a href="www.adafruit.com"&gt;www.adafruit.com&lt;/a&gt;, and my own &lt;a href="http://www.toastedcircuits.com"&gt;www.toastedcircuits.com&lt;/a&gt;).  I fully expect that 2020 will see ubiquituous desktop manufacturing with communities not focused on building desktop manufacturing machines (as exists today) but focused on what can be made.  By 2050 we'll probably be designing our own plants and animals, probably with an incompatible biology for obvious reasons.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Software Archaeology&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finally, it is an interesting piece of computer archaeology as its "heyday" fortuitously happened at the end of the &lt;a href="http://en.wikipedia.org/wiki/Prehistory"&gt;prehistoric times&lt;/a&gt; (as people years from now will see these dark ages before the emergence of the global hive mind and recording device we call the internet). &lt;br /&gt;&lt;br /&gt;What can be recovered by reaching back across the curtain?  This is quite an interesting question and many scholarly articles have considered it (I have read several articles in Scientific American on this subject over the past decade for instance).  These articles tend to warn against electronic media for pretty obvious reasons.  Quick summary:  Your grandkids find a 3.5" floppy (or CDROM) in the attic.  Will they even recognise it as electronic media?  How will they read it without a disk drive?  Even if they manage to get the bits, will modern computers be able to run the programs, read the documents, play the movies?&lt;br /&gt;&lt;br /&gt;Well, for GameMaker, it turns out that quite a lot is possible!  You can even play the created games in a Java simulator called "&lt;a href="http://www.dosbox.com/"&gt;DOSbox&lt;/a&gt;" in the wiki posted in the first paragraph of this article.  For me, it was quite a trip to play games (and see the GameMaker software on Youtube) that I created 15 years ago.  You results may vary.  Remember, these were games built 15 years ago mostly by teenagers!  Please don't go in there expecting amazing stuff -- go in there amazed that these kids could put together this stuff at all!  But if you hunt for gems of creativity I promise you'll find some.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Software Obscurity&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And what did I do after GameMaker?  Have I been washing windows for 20 years?  No I've been writing vast quantities of code in various startup companies which have been sold for a sum total of approximately a half billion dollars.  But all that code is gone.  A company gets sold, the product is either canned or is successful for a few years.  Then it is done.  Can I get my code for the next project?  No. &lt;br /&gt;&lt;br /&gt;I have even attempted to purchase some from prior employers.  No dice, price does not matter, the company is not in the business of selling its software, so its just not possible to find a manager willing to even consider the proposition.  Because what if hidden in that chunk of software is something really important?&lt;br /&gt;&lt;br /&gt;So if there ever was an argument for open source software and open source content then this is it!  As engineers in corporate America (and elsewhere) we build machines for obscurity.  We write novels to be read by no-one.  We architect palaces of structured information that shall soon disappear.&lt;br /&gt;&lt;br /&gt;Let's try to do that as little as possible.&lt;br /&gt;&lt;br /&gt;G. Andrew Stone&lt;br /&gt;2011&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;The next episodes of this little blog may delve in more detail about RSD and GameMaker's history, etc.  Perhaps only interesting to those who actually used it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-2811118646345536103?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/2811118646345536103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2011/06/rsd-gamemaker.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2811118646345536103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2811118646345536103'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2011/06/rsd-gamemaker.html' title='RSD GameMaker'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-2957693756800258492</id><published>2010-10-10T06:32:00.000-07:00</published><updated>2010-10-11T08:24:01.970-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Brevia'/><category scheme='http://www.blogger.com/atom/ns#' term='placement'/><category scheme='http://www.blogger.com/atom/ns#' term='Brevia lpf file'/><category scheme='http://www.blogger.com/atom/ns#' term='XP2'/><category scheme='http://www.blogger.com/atom/ns#' term='Lattice'/><category scheme='http://www.blogger.com/atom/ns#' term='pin definition'/><title type='text'>Lattice XP2 Brevia Diamond Starter Project</title><content type='html'>Its a royal PITA to specify the pinout of a 144 pin part!  So there is no point to doing this more than once -- across the entire internet.&lt;br /&gt;&lt;br /&gt;Its unfortunate that Lattice does not provide one, but their Demo project does not specify the IOs since they are not used.&lt;br /&gt;&lt;br /&gt;In my &lt;a href="http://code.google.com/p/effluviaofascatteredmind/"&gt;code repository&lt;/a&gt; is a Diamond project that specifies all XP2 IOs as used by the Brevia board.  And it sets the XP2 part up with 3 clocks, 400mhz, 50mhz, and 25mhz.  Of course you can change these clock values by editing the "pll" module.&lt;br /&gt;&lt;br /&gt;You &lt;a href="http://code.google.com/p/effluviaofascatteredmind/source/checkout"&gt;checkout&lt;/a&gt; the entire project (recommended), or browse and pull down the key files to add into your own project:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/effluviaofascatteredmind/source/browse/trunk/fpga/latticeBreviaStarter/top.v"&gt;top.v&lt;/a&gt;: the "main" verilog file&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/effluviaofascatteredmind/source/browse/trunk/fpga/latticeBreviaStarter/starter1.lpf"&gt;starter1.lpf&lt;/a&gt;: the file that places the verilog symbols onto particular pins&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/effluviaofascatteredmind/source/browse/trunk/fpga/latticeBreviaStarter/pll.v"&gt;pll.v&lt;/a&gt;: autogenerated pll module that sets up the 3 clocks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-2957693756800258492?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/2957693756800258492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-xp2-brevia-diamond-starter.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2957693756800258492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2957693756800258492'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-xp2-brevia-diamond-starter.html' title='Lattice XP2 Brevia Diamond Starter Project'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-5525785705358012567</id><published>2010-10-05T18:08:00.000-07:00</published><updated>2010-10-05T18:57:37.609-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Brevia'/><category scheme='http://www.blogger.com/atom/ns#' term='64-bit'/><category scheme='http://www.blogger.com/atom/ns#' term='XP2'/><category scheme='http://www.blogger.com/atom/ns#' term='Diamond'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Lattice'/><title type='text'>Lattice Diamond on Ubuntu 10.04 64 bit</title><content type='html'>For some reason, Lattice provides its new Diamond GUI for the &lt;a href="http://distrowatch.com/dwres.php?resource=major"&gt;second most popular Linux distribution&lt;/a&gt; instead of Ubuntu, the most popular distribution.&lt;br /&gt;&lt;br /&gt;Here is how to fix their mistake :-).  Additionally, they only provide 32 bit binaries but I have a 64 bit system.  So this how-to solves that problem as well.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Installing the IDE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1:  Download Diamond's .rpm located &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.latticesemi.com/products/designsoftware/diamond/"&gt;here&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;, and apply for a license.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2:  Install "alien", the .rpm to .deb package converter.&lt;/span&gt;&lt;br /&gt;sudo apt-get install alien&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3: install "getlibs"&lt;/span&gt;&lt;br /&gt;This handy script will install the 32-bit version of libraries even if you are running 64-bit Ubuntu.  Since Diamond is 32 bit you will have to install some 32 bit stuff.&lt;br /&gt;&lt;br /&gt;click &lt;a href="http://ubuntuforums.org/showthread.php?t=474790"&gt;here&lt;/a&gt; for info (http://ubuntuforums.org/showthread.php?t=474790)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 4: Install 32 bit libraries (if on 64 bit Ubuntu)&lt;/span&gt;&lt;br /&gt;apt-get install ia-32libs&lt;br /&gt;sudo getlibs -p libmotif3&lt;br /&gt;&lt;br /&gt;I am doing this from memory...if you run diamond (later step) and get a missing .so, please run "getlibs -l &lt;file.so&gt;" to install that library and post a comment so I can update this HOW-TO!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 5: Run alien on the diamond RPM.&lt;/span&gt;&lt;br /&gt;When the diamond RPM is downloaded, run alien on it:&lt;br /&gt;alien -d diamond_1_0-base-135-i386-linux.rpm&lt;br /&gt;&lt;br /&gt;Wait for a very long time.  This will ultimately have an error and drop you back to the Linux prompt.  It will not hang (be patient).   However you will find that it created a subdirectory called "diamond_1_0-base-1.0" off your current directory. Everything we need is in there.  I'll copy it to /usr/local so it is accessible:&lt;br /&gt;&lt;br /&gt;sudo cp -r diamond_1_0-base-1.0/usr/local /usr/local&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 6: Copy the license&lt;/span&gt;&lt;br /&gt;You should have gotten a license file in your email stream from step 1.&lt;br /&gt;Save that file into the diamond subdirectory: /usr/local/diamond/1.0/license/license.txt&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 7: Run it!&lt;/span&gt;&lt;br /&gt;/usr/local/diamond/1.0/bin/lin/diamond&lt;br /&gt;&lt;br /&gt;if you get any missing libraries, please attempt to "getlibs" (see step 4) and post a comment here so others can benefit from your pain :-).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Installing the Lattice USB Programmer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you actually program your board, you'll have to install drivers for the programmer dongle.&lt;br /&gt;&lt;br /&gt;The Lattice USB programmer uses libusb so that is convenient as no kernel module needs to be built.  I think there is another programmer that uses the FTDI 2232 chip that does require drivers to be installed.  This how-to won't cover that one, or the parallel port programmer (which I was unable to get working).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1:  install libusb&lt;/span&gt;&lt;br /&gt;sudo apt-get install libusb-1.0-0&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2:  Add the USB device to "udev"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;sudo emacs /etc/udev/rules.d/10-local.rules&lt;br /&gt;&lt;br /&gt;Append this line:&lt;br /&gt;#lattice&lt;br /&gt;BUS=="usb",ACTION=="add",SYSFS{idVendor}=="1134",SYSFS{idProduct}=="8001",MODE=="0660",OWNER=="root",SYMLINK+="lattice-%n"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3:  Plug in the USB device programmer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You should see a device in /dev named "lattice":&lt;br /&gt;&lt;br /&gt;~$ ls /dev/lat*&lt;br /&gt;/dev/lattice-6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 4: Fix permissions.&lt;/span&gt;&lt;br /&gt;Shown here is an impermanent fix.  Every time you turn off your computer or remove the programmer you'll have to re-run this, since the device is removed and recreated during these events.  I'm sure that some of you Ubuntu/Linux wizards can tell me how to make it permanent...&lt;br /&gt;&lt;br /&gt;sudo chmod a+rw /dev/lat*&lt;br /&gt;&lt;br /&gt;That's it!  The ispVM programming tool should auto-detect the cable now.&lt;br /&gt;&lt;br /&gt;Have fun and post some OSS designs!&lt;/file.so&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-5525785705358012567?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/5525785705358012567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-diamond-on-ubuntu-1004-64-bit.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5525785705358012567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5525785705358012567'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-diamond-on-ubuntu-1004-64-bit.html' title='Lattice Diamond on Ubuntu 10.04 64 bit'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-6576362382641269870</id><published>2010-10-04T18:07:00.000-07:00</published><updated>2010-10-04T18:55:31.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Brevia'/><category scheme='http://www.blogger.com/atom/ns#' term='Open hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='OSS'/><category scheme='http://www.blogger.com/atom/ns#' term='FPGA'/><category scheme='http://www.blogger.com/atom/ns#' term='XP2'/><category scheme='http://www.blogger.com/atom/ns#' term='Lattice'/><title type='text'>Lattice FPGA -- They are beginning to get OSS</title><content type='html'>After a quite a bit of comparative evaluation I chose the Lattice XP2 FPGA and the &lt;a href="http://www.latticesemi.com/products/developmenthardware/developmentkits/xp2breviadevelopmentkit.cfm"&gt;Brevia demo board&lt;/a&gt; for a bit of hardware hacking.  (In short, I wanted a non-volatile FPGA or large CPLD, and found that the XP2 and MachXO seemed better than the Altera and Xilinx offerings).&lt;br /&gt;&lt;br /&gt;And I'm happy to say that unlike my prior complaints about Cypress, I do think that Lattice "gets it" around open source hardware.&lt;br /&gt;&lt;br /&gt;Al is not perfect, but they seem to be moving rapidly in the right direction.&lt;br /&gt;&lt;br /&gt;First off, they recently obsoleted their old GUI and released their "Diamond" GUI for both Windows and Linux.   Its a little crunchy still on Linux.  However, this is a major, probably very expensive, initiative and Lattice should be commended for letting Linux be part of it!  While they officially only support Red Hat, check out this output coming from the "compiler":&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Warning: You are running on an unsupported platform&lt;br /&gt;'synplify_pro' only supports Red Hat Enterprise Linux 4.0 and above&lt;br /&gt;current platform: Ubuntu 10.04.1 LTS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's right!  I managed to get it up on Ubuntu 64 bit (I'll provide a little HOW TO in my next post).&lt;br /&gt;&lt;br /&gt;Secondly, they priced the board extremely well at $29.&lt;br /&gt;&lt;br /&gt;Third, they provide a lot of free libraries (called "designs" or "IP" in the hardware world) so long as you only use them on Lattice parts.   Personally, I can live with that.  After all Lattice is in the business of selling chips.  And you know if I decide to switch chips, I can implement the underlying library myself and still have benefited from using Lattice's library to get me prototyping my application code faster...&lt;br /&gt;&lt;br /&gt;Fourth, the GUI/compiler is free (well, its a 1 year free license so I guess someday they could take that away) and command line accessible.&lt;br /&gt;&lt;br /&gt;Fifth, the USB programmer uses libusb, so you don't even need to install a special driver.  This makes it a lot easier to run on different linux distros.&lt;br /&gt;&lt;br /&gt;This is a great first step!!!  Its perfect for OSS hackers and students.&lt;br /&gt;&lt;br /&gt;... but there is stuff Lattice needs to work on.&lt;br /&gt;&lt;br /&gt;First, my biggest gripe is that the Brevia board ships with a parallel port programmer.  But who has parallel ports anymore?  And by the way, purchasing a USB-&gt;parallel converter WILL NOT work.  Those converters do not translate all parallel signals.  Lattice FAEs claim some converters work, but will not endorse a particular one so we are left guessing.&lt;br /&gt;&lt;br /&gt;In fact I was unable to get the parallel port programmer to work.&lt;br /&gt;&lt;br /&gt;Second, the USB programmer purchased separately costs $150!!! This is an evil bait-and-switch.  Honestly I haven't priced components out, but in this market I'd bet that USB components are cheaper than parallel because its all about volume.  So what is going on here!!?&lt;br /&gt;&lt;br /&gt;However its standard JTAG so other programmers should also work...&lt;br /&gt;&lt;br /&gt;Third, the ispVM device programming tool was poorly ported to Linux.  In particular, you actually specify the old 8088 parallel port number 0x378 (or whatever) to identify the parallel port, not the device name (and again I never got it to work with the parallel programmer).&lt;br /&gt;&lt;br /&gt;Fourth, they only offer RPMs.  Lattice, even if you don't want to support every distro, its traditional to just jam your program in a big gzipped tarball archive so we can pull it down and install it by hand by coping it to /usr/local or something along those lines.&lt;br /&gt;&lt;br /&gt;And finally, Diamond is still a little rough around the edges.  For example, sometimes the editor stops working and I have to close and reopen my project.  Even worse, I managed to get my project into an inconsistent state where some generated files thought that certain clock resources existed but I had removed them.  The easiest way out of that was to create a new project :-(, and copy my source code over.&lt;br /&gt;&lt;br /&gt;However Diamond is very new.  I expect very good things. &lt;br /&gt;&lt;br /&gt;All in all its a great start!  Thanks Lattice!&lt;br /&gt;&lt;br /&gt;Disclosure: I am in no way affiliated with Lattice, other than having bought their $29 Brevia board...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-6576362382641269870?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/6576362382641269870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-fpga-they-are-beginning-to-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6576362382641269870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6576362382641269870'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-fpga-they-are-beginning-to-get.html' title='Lattice FPGA -- They are beginning to get OSS'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-1594648897344067372</id><published>2010-08-07T04:17:00.000-07:00</published><updated>2010-08-13T18:26:44.118-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='embedded hardware development'/><category scheme='http://www.blogger.com/atom/ns#' term='Cypress'/><category scheme='http://www.blogger.com/atom/ns#' term='Arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='PSOC'/><category scheme='http://www.blogger.com/atom/ns#' term='AVR'/><title type='text'>Arduino/AVR vs Cypress/PSOC</title><content type='html'>I've recently been working on a simple PSOC (www.cypress.com/psoc) project using the CY8C64315 USB chip and can't help but compare it to the popular Arduino platform since it is pretty similar to the AVR 328P.  These are my observations:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Feature Comparison&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Cypress/PSOC 9, Arduino/AVR 5&lt;br /&gt;&lt;br /&gt;Initially I chose PSOC because it has some great features packed into a tiny 16 pin QFN part at a cheap price.  In particular it provides a full-speed USB device with very few external components -- not even a crystal!  It runs at 24Mhz instead of the AVR's 20mhz and contains SPI, I2C, a bunch of IOs and so forth.&lt;br /&gt;&lt;br /&gt;One issue is that it does not contain a serial UART (but other, bigger PSOC parts do), but I'm hoping to do a soft-serial implementation.&lt;br /&gt;&lt;br /&gt;Perhaps its kind of silly but I didn't want my USB controller to be larger, more expensive, and have more pins than an embedded CPU itself (but when you get right down to it, it is in fact on par or more powerful than the 328p)!  So the tiny part size combined with good features was the clincher for me.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Documentation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cypress/PSOC 3, Arduino/AVR 10&lt;br /&gt;&lt;br /&gt;The Cypress Application Note search tool is totally impossible to use.  And their community site www.psocdeveloper.com is better but not "alive" like the Arduino or even avrfreaks.  Its too tightly coupled with Cypress I think.&lt;br /&gt;&lt;br /&gt;And none of this stuff comes up in google searches. &lt;br /&gt;&lt;br /&gt;Note to Cypress -- you are NOT a SEARCH company!  Just post all your App Notes in HTML form on a public site and let Google do the job.  It will do it much better and you'll save some money.&lt;br /&gt;&lt;br /&gt;One wild/good thing; I posted an issue bringing the chip up and actually got an essentially unsolicited telephone call from a real human being engineer the next day to help me (but had already figured it out).  So that can make up for a lot of doc issues, but of course its pretty expensive for Cypress...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Hardware Design&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cypress 2, AVR 10&lt;br /&gt;&lt;br /&gt;2. Application Schematic?  It seems that Cypress didn't bother to put one in the datasheet.  In fact I had to glean portions of the full "typical application schematic" from a bunch of "Application Notes" -- USB from here, ISSP from there.  And of course those schematics were not necessarily for the chip variant I chose so there was lots of uncertainty in this process.&lt;br /&gt;&lt;br /&gt;In contrast the Arduino project and all its variants are open hardware, so there are lots of circuit examples to choose from.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;PSOC Designer vs Arduino IDE&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cypress 5, Arduno 5&lt;br /&gt;&lt;br /&gt;PSOC is supposed to be some reconfigurable hardware "magic" that requires a fancy windows-only IDE.  Not in my chip.  Everything is just registers AFAIK.  But still you can use a GUI to configure things and then it generates the code to write these registers for you.  Now, this might seem cool, but actually it just gets in the way.  It gives Cypress and excuse to not supply an API like the Arduino's "pinMode" and not to supply good docs.  So what if you want to CHANGE the behavior of a pin while your program runs -- you've got to delve into the registers...&lt;br /&gt;&lt;br /&gt;The rest of the IDE is everything you'd expect from a programmer's IDE.  Good job Cypress!  You are just as good as the free Eclipse :-).&lt;br /&gt;&lt;br /&gt;However I do have one or 2 beefs.  It:&lt;br /&gt;1. Only runs on windows *sigh*&lt;br /&gt;2. Pops up an irritiating "Programming" dialog box.  This should be done in a small side-docked pane so the programmer can continue to WORK while the chip gets programmed...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Build Toolchain&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Cypress/PSOC 5, Arduino/AVR 5&lt;br /&gt;&lt;br /&gt;G++, GCC???&lt;br /&gt;&lt;br /&gt;For some reason, instead of adding a gcc backend for the PSOC CPU, Cypress decided to go with some commercial C compiler.  So no C++.&lt;br /&gt;&lt;br /&gt;The result is a bit more like "Kiel" C then gcc and in particular has irritatingly difficult tranlation between a string stored in "flash" vs one in "ram".  In fact, you have to define 2 functions one to handle "__flash" strings and one to handle normal "char *". *sigh*&lt;br /&gt;&lt;br /&gt;But of course Arduino has this strange thing called "processing" with is actually C++ with some "try to help me but actually get in the way" thrown in so really average marks on both.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to "Blink" (Basic programs/sketches)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cypress/PSOC 7, Arduino/AVR 10&lt;br /&gt;&lt;br /&gt;Its pretty INSANELY hard to figure out how to do simple things like configure a digital input (you use the GUI to graphically set the pin as CPU open-drain, then in code write the bit HIGH).  Also standard C functions like "printf" are there but don't work... better that they not be there if they don't work.&lt;br /&gt;&lt;br /&gt;Yet at the same time, it can be very EASY to do an entire USB HID device.  So it just depends on how many Cypress libraries you can use.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;&lt;br /&gt;Software Layers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cypress/PSOC 9, Arduino/AVR 9&lt;br /&gt;&lt;br /&gt;Ok, I've got to give cred to Cypress for being the 1st hardware company (AFAIK) to realise that we don't want to program at the register level.  Yes, the GUI has "user modules" and you just pull them into your project to get massive functionality like a USB endpoint.&lt;br /&gt;&lt;br /&gt;One nasty issue the use of lots of assembly??!!?  All the Cypress libraries AFAIK are written in assembly.  This makes reading the code hard :-).  And also you can't ignore it; installing things like interrupt handlers requires you to get down in there and call out to your C.  And this is NOT easy; to make the C compiler correctly save state, you have to basically trick the CPU into calling your C routine as if it was an interrupt even though you are already IN an interrupt.  There's an entire App Note about how to do it :-(.&lt;br /&gt;&lt;br /&gt;The advantage is probably smaller code sizes.  But the cost is essentially that if you need to modify the library or add a feature, you have to either rewrite the whole thing yourself in C, or learn PSOC assembly which of course ties you and your work inseparably to this processor.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Summary:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Its a neat little device with lots of potential.  Great hardware, great software/support philosophy but not so good implementation.  But its a pretty steep learning curve...&lt;br /&gt;&lt;br /&gt;Now, Arduino/AVR generally relies on the community to provide great programming libraries, examples, tutorials and general help.  And we do. &lt;br /&gt;&lt;br /&gt;Cypress seems to be doing all/most of the work on its own.  It seems to be caught attempting to implement a modern philosophy with a traditional unidirectional information-flow structure.  &lt;br /&gt;&lt;br /&gt;So while I give cred to Cypress for the tremendous effort I'm amazed at its total disregard for the open source movement -- in compilers, in IDE, in software libraries.&lt;br /&gt;&lt;br /&gt;And I'm surprised at its inability to truly capitalize on internet resources and community.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-1594648897344067372?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/1594648897344067372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/08/arduinoavr-vs-cypresspsoc.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1594648897344067372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1594648897344067372'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/08/arduinoavr-vs-cypresspsoc.html' title='Arduino/AVR vs Cypress/PSOC'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-7782690061903391969</id><published>2010-06-09T12:25:00.000-07:00</published><updated>2010-06-09T12:43:58.904-07:00</updated><title type='text'>Proposal for an "Open Device" License</title><content type='html'>There is an interesting read about an "open hardware" license here:&lt;br /&gt;&lt;a href="http://www.tapr.org/ohl.html"&gt;http://www.tapr.org/ohl.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But I am interested in something that goes much further in several ways. &lt;br /&gt;&lt;br /&gt;First off, my license would enforce the right and ability to modify a product and (especially) its firmware/software after it has been produced.  This is what I mean by "open device" as opposed to simply "open hardware".  In a world where the PC is increasingly pushed into a niche market, it is very important to protect the right to run software on other hardware, cell phones for example.  I believe that the openness of the IBM PC is what created the personal computer revolution -- and why Apple lost out... as much as I love what Apple is doing on the physical side with the ipod, iphone, ipad, we need to ensure that Apple's restrictive policies do not prevail in devices or we will lose innovation in the personal device marketplace to the detriment of everyone who uses the devices.&lt;br /&gt;&lt;br /&gt;This "modifiable device" restriction is also nice because it lets the original producer (and others) can use a high volume producer's hardware, &lt;span style="font-style: italic;"&gt;so long as its functionality is accessible&lt;/span&gt;..  I believe that this would satisfy many open hardware developers since some are not motivated to make money; they are simply building a device that does not currently exist, and would be happy instead to buy it at Wallmart for significantly less cost.  On the other hand, the greatest IP "theft" would be for a company to take a piece of open hardware and inaccessibly embed it within some consumer product, thereby reaping all the rewards of the open hardware communities' efforts and giving nothing back in return.&lt;br /&gt;&lt;br /&gt;Secondly, I disagree with the TAPR's reliance on the GPL license to protect software, since (as I said above) it does not protect the ability to run that software on some device.  It is very common for a company to comply with GPL by releasing the source of a Linux port onto a new CPU but in fact have no way for the end user to actually upload that release onto the CPU within the company's product!  And generally other available hardware will not exist for the new CPU...  Ironically, this effect is what drives some open hardware development, because the community then must produce (at great personal expense) custom hardware to utilize the Linux port...&lt;br /&gt;&lt;br /&gt;There is one instance that I know of where in fact the software was released and the hardware fortuitously provided an update mechanism.  This was the WRT-54G router.  This device was a tremendous market success, and &lt;a href="http://en.wikipedia.org/wiki/List_of_wireless_router_firmware_projects"&gt;open source community's modifications&lt;/a&gt; to this router were so popular that some features were actually pushed back into the commerical release, AND even though the company eventually built a cheaper version on vxworks (a different operating system), they continued to sell the original under the product name WRT-54GL (&lt;a href="http://www.wi-fiplanet.com/tutorials/article.php/3562391/The-Open-Source-WRT54G-Story.htm"&gt;more...&lt;/a&gt;).  What if this phenomemon was the norm instead of the exception!?&lt;br /&gt;&lt;br /&gt;Therefore, I believe that the hardware and software in embedded devices is intrinsically related -- one is almost worthless without the other.  And finally, my experience as a software architect within the telecom industry and my experience as an open hardware developer is that in fact the software/firmware is 90% or more of the time effort.  Since it is the major cost, it provides great leverage to pry off the lid of "closed" devices.&lt;br /&gt;&lt;br /&gt;When you add these and a few other ideas together, you end up not with "open hardware", but something that looks a lot more like an "open device".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-7782690061903391969?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/7782690061903391969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/06/proposal-for-open-device-license.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/7782690061903391969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/7782690061903391969'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/06/proposal-for-open-device-license.html' title='Proposal for an &quot;Open Device&quot; License'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-1813745577969364965</id><published>2010-06-02T06:57:00.000-07:00</published><updated>2010-06-02T08:10:28.501-07:00</updated><title type='text'>Success, Wall Street Style</title><content type='html'>I just finished reading &lt;a href="http://www.amazon.com/Den-Thieves-James-B-Stewart/dp/067179227X"&gt;"Den of Thieves" by James Stewart&lt;/a&gt; which is about the junk bond scandal that hit wall street in the '80s.  What is fascinating about it is the similarities between it and the recent financial meltdown.  Just swap "toxic asset" mortgages for corporate loans (AKA junk bonds) and hit the fast forward button.&lt;br /&gt;&lt;br /&gt;Since this is a blog, I'm going to skip all explanations (read the book) and just hop to my observations:&lt;br /&gt;&lt;br /&gt;First off, the financial system essentially and intrinsically encourages abuse.  Capitalism trends towards perfect markets -- therefore there is an ever decreasing profit spread for financial guys to take advantage of.  &lt;span style="font-style: italic;"&gt;But wall street types are self-selected to not be happy with ever decreasing profits&lt;/span&gt;.  They will find or create an edge.&lt;br /&gt;&lt;br /&gt;Second, the junk-bond related crimes were totally unnecessary; they just added a buck or two per share to an already over-inflated, highly profitable transaction and sometimes "encouraged" a deal to go through if it was stalling.  Judging by the lack of major arrests in the toxic asset meltdown, Wall street learned that crime in fact doesn't pay nearly as well as the long, legal con.&lt;br /&gt;&lt;br /&gt;Third, never trust finance guys even as part of a reputable institution!  [In fact, let me go on a limb and say, its your life, don't trust anyone!  For major life issues like financial and medical, respect the expert opinions but learn their biases (for example, surgeons LIKE to do surgery, duhh!) and then spend the time to figure it out yourself!]&lt;br /&gt;&lt;br /&gt;Around 2007-2008 a couple of my friends were buying a house and I was alarmed at the tendency for people to trust the bank's evaluation of how large a loan you could bear.  Essentially they ceded responsibility for picking a reasonable load to the banking "experts", and did not bother to do even the most basic math.  &lt;span style="font-style: italic;"&gt;"If the bank is willing to offer me that much I must be good for it"&lt;/span&gt; is how the thinking goes.  I think that this happened on a nationwide level.  But I would tell my friends "yes but the bank's goal is for you to be in debt for the rest of your life, your goal should be to not be in debt.  Because when you are in debt, you are paying 10% or more to your creditor.  You are going into debt to buy more stuff, but ironically you'll end up with less".&lt;br /&gt;&lt;br /&gt;Little did we know that many banks did not even care whether the loan could be repaid...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;Recipe for Wall Street Mega-Success&lt;/span&gt;&lt;br /&gt;(slashdot style)&lt;br /&gt;&lt;br /&gt;1. Identify an information advantage.  Look in unregulated areas of finance.  &lt;span style="font-style: italic; font-weight: bold;"&gt;For extra credit, artificially create an information advantage in your favor&lt;/span&gt;.  For example, bundle financial instruments so the underlying entities are hidden.  Write contracts that only finanical lawyers can understand (insurance is a great area of opportunity for this method).  Transform an out-of-favor, high-risk financial instrument into one that is "in-favor".  Take advantage of people's trust in "experts" -- i.e. yourself.&lt;br /&gt;&lt;br /&gt;2. Market, market, sell, sell, sell.  Get college professors to write papers about how low risk your market historically was (before you entered it).&lt;br /&gt;&lt;br /&gt;3. Jam increasingly ludicrious and high risk underlying entities into your framework since that maximizes your profit by reducing the base cost.&lt;br /&gt;&lt;br /&gt;4. Use recursion to keep the aura of good times going -- if an issue is about to fail, grab it up, twist it around, and jam it back into the system (AKA refinancing).&lt;br /&gt;&lt;br /&gt;3. ??? (this is where the optional crimes are committed)&lt;br /&gt;&lt;br /&gt;4. Profit!!!&lt;br /&gt;&lt;br /&gt;5. You have 3-7 years; the fall will be from the summit, sudden and hard.  be ready to bail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-1813745577969364965?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/1813745577969364965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/06/success-wall-street-style.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1813745577969364965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1813745577969364965'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/06/success-wall-street-style.html' title='Success, Wall Street Style'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-6086261268517260877</id><published>2010-02-06T12:39:00.000-08:00</published><updated>2010-06-01T20:01:37.817-07:00</updated><title type='text'>Arduino PWM on all pins.</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;What is PWM?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;PWM (pulse width modulation) is the art of faking a particular voltage by rapidly moving between 2 other voltages.  For example if you have a digital logic line that is 0 volts when LOW or 5 volts when HIGH, you can "trick" a multimeter into reading 1 volt by setting the line to low for 4/5s of the time and high for 1/5 of the time.  The ratio of high to low is called the "duty cycle" and is specified in a percentage.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Why Use PWM?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can trick a lot of other things too if you toggle the line tens to hundreds of times a second.  For example if you connect a LED it will appear dimmer due to the same "persistence of vision" effect that makes movies appear smooth.&lt;br /&gt;&lt;br /&gt;Another example is driving motors.  Motors contain electromagnets which cause electrical inductance (in analogy "momentum").  If you put a diode across the motor's leads (backwards) then when the motor is turned off, the collapse of the magnetic field continues to drive current through the wire, and through the diode back to the other side of the motor.  This current maintains the magnetic field!  If there was no resistance this would go on forever (BTW this is how superconductors float above magnets).  But since there is resistance, the circulating current slowly dies out.&lt;br /&gt;&lt;br /&gt;But if you are doing PWM on the motor, a new influx of energy will re-energize the motor's coils resulting in a smoothly turning motor.  But the speed of the motor will vary based on the duty cycle of the PWM.  So you can use PWM to change the speed of a DC motor.&lt;br /&gt;&lt;br /&gt;The Arduino has some hardware-based PWM.  But only on certain pins.  For things like motors, you do not need to PWM very fast so it can be done in software.  So I have made a software PWM class for Arduino sketches that works on all pins.&lt;br /&gt;&lt;span style="font-size:130%;"&gt; &lt;span style="font-style: italic; font-weight: bold;"&gt;The Four Line states in an AVR microcontroller&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another cool feature is that it will do PWM between any 2 line states.  You may normally think of a digital line as having only 2 states (high or low) but the Arduino actually offers 4 states, high, low, high impedence, and pull up.&lt;br /&gt;&lt;br /&gt;A lot of beginners think of the "low" state as "off" but really it means driven to 0 volts.  So if you put a light between a "low" pin and 5v, the light will turn on!&lt;br /&gt;&lt;br /&gt;On the other hand "high impedence" actually means "disconnected" or "floating" -- at least as close as you can get to that using solid state electronics.  So in a high impedence state, the light described above would NOT turn on.  But one issue with a line in the "high impedence" state is that its voltage is undefined and can be sensed as high or low and change between the 2 due to vagaries of electric fields on the board, etc.&lt;br /&gt;&lt;br /&gt;"Pull up" refers to a connection to 5v through a large resistor.  So it is "high impedence" in the sense that it cannot drive anything, and if driven by some external device it will follow that device.   But if the line is otherwise floating, the connection to 5v thru the resistor will make the line show as high.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sites.google.com/site/andrewstonefiles/arduino/softpwm-100601a.zip"&gt;DOWNLOAD&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt; &lt;span style="font-style: italic; font-weight: bold;"&gt;The Code&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#define PWM_NUM_PINS 16&lt;br /&gt;#define PWM_MAX_DUTY 255&lt;br /&gt;#define PWM_DEFAULT_FREQ (16000000.0/128.0) //2MHz for /8 prescale from 16MHz&lt;br /&gt;&lt;br /&gt;//?? Software based PWM (Pulse width modulation) library for the ATMEGA168/328 (Arduino).&lt;br /&gt;// &lt;br /&gt;// This class implements PWM in software.  PWM is a method whose purpose is to emulate an analog voltage by rapidly toggling a digital&lt;br /&gt;// pin between the high and low states.  By changing the duty cycle -- the percent of time the pin is "on" verses "off" the apparent voltage changes.&lt;br /&gt;// This technique is only useful if the pin is controlling a device that averages voltages; for example:&lt;br /&gt;// * Inductors (electromagnets, motors)&lt;br /&gt;// * Capacitors&lt;br /&gt;// * Human perception (via LEDs for example)&lt;br /&gt;// This library does not work as efficiently as the hardware based PWM availabe in the ATMEGA, so that should be used if possible.&lt;br /&gt;// However this library offers PWM on all pins, and also allows you to specify what the "on" and "off" pin states are.  For example, you could choose the "off" state to be high impedence.&lt;br /&gt;// &lt;br /&gt;class SoftPWM&lt;br /&gt;{&lt;br /&gt;  public:&lt;br /&gt;  typedef enum&lt;br /&gt;  {&lt;br /&gt;    DRIVEN_LOW = 2 | 0,&lt;br /&gt;    DRIVEN_HIGH = 2 | 1,&lt;br /&gt;    DRIVEN = 2,&lt;br /&gt; &lt;br /&gt;    FLOATING = 0,&lt;br /&gt;    PULL_UP = 1,&lt;br /&gt;    HIGH_IMPEDENCE = 0,&lt;br /&gt;&lt;br /&gt;    UNUSED = 4   &lt;br /&gt;  } PinBehavior;&lt;br /&gt;  //?? Constructor&lt;br /&gt;  SoftPWM();&lt;br /&gt;&lt;br /&gt;  //?? Call this periodically to trigger a state change&lt;br /&gt;  void loop(void);&lt;br /&gt;  &lt;br /&gt;  //?? Automatically call the loop() function periodically.  Once you call this function YOU SHOULD NOT CALL LOOP()!&lt;br /&gt;  void startAutoLoop(int timer=2,int frequency=PWM_DEFAULT_FREQ);  &lt;br /&gt;  //?? Stop automatic looping.&lt;br /&gt;  void stopAutoLoop(void);&lt;br /&gt;  &lt;br /&gt;  //?? Duty Cycle.  The fraction of time that the pin is HIGH is duty/255&lt;br /&gt;  uint8_t duty[PWM_NUM_PINS];&lt;br /&gt;  &lt;br /&gt;  //?? Set what it means for a pin to be off or on.&lt;br /&gt;  // Typically you would want to PWM an output pin and toggle output voltage.  This is what PWM normally means, and is the default.&lt;br /&gt;  //       However, for other applications you may want to toggle the impedence and value simultaneously.&lt;br /&gt;  //       For example, if the pin is sinking the base of a PNP transistor then you would switch from a high impedence (i.e. open circuit) state to a low output state (i.e. closed circuit, sinking current).&lt;br /&gt;  //       &lt;br /&gt;  void enablePin(int pin, PinBehavior offMode=DRIVEN_LOW, PinBehavior onMode=DRIVEN_HIGH)&lt;br /&gt;  {&lt;br /&gt;    pinOnBehavior[pin] = onMode; &lt;br /&gt;    pinOffBehavior[pin] = offMode;&lt;br /&gt;  }&lt;br /&gt;  void disablePin(int pin) { pinOnBehavior[pin] = UNUSED; pinOffBehavior[pin] = UNUSED; }&lt;br /&gt; &lt;br /&gt;  //?? Set all duty cycles to 0&lt;br /&gt;  void zero(void)&lt;br /&gt;  {&lt;br /&gt;    for (int i=0;i != PWM_NUM_PINS;i++)&lt;br /&gt;      duty[i] = 0;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  uint8_t pinOffBehavior[PWM_NUM_PINS];&lt;br /&gt;  uint8_t pinOnBehavior[PWM_NUM_PINS];&lt;br /&gt;  int bresenham[PWM_NUM_PINS];&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;SoftPWM::SoftPWM()&lt;br /&gt;{&lt;br /&gt;  for (int c=0;c != PWM_NUM_PINS;c++)&lt;br /&gt;  {&lt;br /&gt;    bresenham[c] = 0;&lt;br /&gt;    pinOffBehavior[c] = UNUSED;&lt;br /&gt;    pinOnBehavior[c] = UNUSED;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void SoftPWM::loop(void)&lt;br /&gt;  {&lt;br /&gt;  boolean lvl;&lt;br /&gt;  unsigned char regLvlOut=0;&lt;br /&gt;  unsigned char regLvlIn;&lt;br /&gt;  &lt;br /&gt;  unsigned char regDirOut=0;&lt;br /&gt;  unsigned char regDirIn;&lt;br /&gt;  &lt;br /&gt;  for (int i=0;i != PWM_NUM_PINS;i++)&lt;br /&gt;    {&lt;br /&gt;      if (i==0) { regLvlIn = PORTD; regDirIn = DDRD; }&lt;br /&gt;      if (i==8) { regLvlIn = PORTB; regDirIn = DDRB; }&lt;br /&gt;      &lt;br /&gt;      if (i==8)&lt;br /&gt;      {&lt;br /&gt;        DDRD = regDirOut;&lt;br /&gt;        PORTD = regLvlOut;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      regLvlOut &gt;&gt;=1;&lt;br /&gt;      regDirOut &gt;&gt;=1;&lt;br /&gt;&lt;br /&gt;      if ((pinOnBehavior[i] &amp; UNUSED) == UNUSED)  // If its unused then keep the values the same&lt;br /&gt;        {&lt;br /&gt;          regDirOut |= (regDirIn&amp;1);&lt;br /&gt;          regLvlOut |= (regLvlIn&amp;1);&lt;br /&gt;        }&lt;br /&gt;      else&lt;br /&gt;        {&lt;br /&gt;        bresenham[i] += duty[i];&lt;br /&gt;        if (bresenham[i]&gt;=PWM_MAX_DUTY) &lt;br /&gt;          {&lt;br /&gt;          bresenham[i] -= PWM_MAX_DUTY;&lt;br /&gt;          lvl = true;&lt;br /&gt;          }&lt;br /&gt;        else lvl = false;&lt;br /&gt;        &lt;br /&gt;        if (lvl)&lt;br /&gt;          {&lt;br /&gt;            regLvlOut |= (pinOnBehavior[i]&amp;1) ? 0x80:0;&lt;br /&gt;            regDirOut |= (pinOnBehavior[i]&gt;&gt;1) ? 0x80:0;&lt;br /&gt;          }&lt;br /&gt;        else&lt;br /&gt;          {&lt;br /&gt;            regLvlOut |= (pinOffBehavior[i]&amp;1) ? 0x80:0;&lt;br /&gt;            regDirOut |= (pinOffBehavior[i]&gt;&gt;1) ? 0x80:0;            &lt;br /&gt;          }&lt;br /&gt;      &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;      regLvlIn &gt;&gt;=1;&lt;br /&gt;      regDirIn &gt;&gt;=1;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    if (1)&lt;br /&gt;      {&lt;br /&gt;        DDRB = regDirOut;&lt;br /&gt;        PORTB = regLvlOut;&lt;br /&gt;      }    &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;typedef unsigned char byte;&lt;br /&gt;&lt;br /&gt;int ledPin = 13;&lt;br /&gt;&lt;br /&gt;void testSoftPWM()&lt;br /&gt;{&lt;br /&gt;  SoftPWM pwm;&lt;br /&gt;  pwm.enablePin(ledPin, SoftPWM::DRIVEN_LOW, SoftPWM::DRIVEN_HIGH);&lt;br /&gt;  for (int i=0;i&lt;25600;i++)&lt;br /&gt;    {&lt;br /&gt;      pwm.duty[ledPin] = i/100;&lt;br /&gt;      pwm.loop();&lt;br /&gt;      delay(1);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setup() {}&lt;br /&gt;void loop() { testSoftPWM(); }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-6086261268517260877?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/6086261268517260877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/02/arduino-pwm-on-all-pins.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6086261268517260877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6086261268517260877'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/02/arduino-pwm-on-all-pins.html' title='Arduino PWM on all pins.'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-2686454039998006110</id><published>2010-01-25T21:05:00.000-08:00</published><updated>2010-01-25T21:44:49.044-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python html'/><category scheme='http://www.blogger.com/atom/ns#' term='browser game automation'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pyxpcomext'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='pyshell'/><category scheme='http://www.blogger.com/atom/ns#' term='juiced pyshell'/><category scheme='http://www.blogger.com/atom/ns#' term='xpcom'/><title type='text'>Browser Hacking</title><content type='html'>Firefox has a cool extension called &lt;a href="http://pyxpcomext.mozdev.org/"&gt;pyxpcomext&lt;/a&gt; that sticks a Python interpreter inside your browser!&lt;br /&gt;&lt;br /&gt;But as is it is pretty hard to use unless you are already a browser geek.  For example, it is hard to figure out how to access stuff like a page in the browser because all of the Firefox extension documentation is for either C or JavaScript.  So you have to sort of read those APIs and translate them thru XPCOM into Python.  This is tricky.&lt;br /&gt;&lt;br /&gt;So I extended the pyxpcomext example "PyShell" into something a lot more user friendly (it wraps the most common XPCOM stuff into normal Python function calls) and useful.  You can access and read details about it here: &lt;a href="http://code.google.com/p/juicedpyshell/"&gt;http://code.google.com/p/juicedpyshell/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, what's the point of this, you ask?&lt;br /&gt;&lt;br /&gt;Well, what this means is that you can write a Python program that can interact with your browser &lt;span style="font-style: italic;"&gt;as you are browsing&lt;/span&gt; and even modify the page (sort of like &lt;a href="http://www.greasespot.net/"&gt;greasemonkey&lt;/a&gt;, but in Python) or even "click" the browser to another page for you!&lt;br /&gt;&lt;br /&gt;But that's still technology, how about applications?&lt;br /&gt;&lt;br /&gt;0. Automation of repetitive browser tasks.&lt;br /&gt;&lt;br /&gt;1. Automated test of your live web site if you are a web developer.&lt;br /&gt;&lt;br /&gt;2. Sophisticated ad elimination.&lt;br /&gt;&lt;br /&gt;3. I'm thinking of a history database that remembers not only the link, i.e. "www.cnn.com" but also the &lt;span style="font-style: italic;"&gt;contents&lt;/span&gt; of a page.  Don't you hate it when you browse to an article only to find it gone!&lt;br /&gt;&lt;br /&gt;4. Python XML/HTML development.  If you are writing a Python back end server then your python is generating HTML.  Its pretty cool to just be able to write hprt(" &lt;&gt; My Header &lt; /h1 &gt;") in the Juiced Python Shell, and actually SEE the rendered HTML appear. Its just like the Python standard "print" command but understands html!  This really speeds up the dev/test cycle.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204);font-size:130%;" &gt;But why not...?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;...just write an app that grabs pages as an http client?&lt;/span&gt;  Well, because your app can't execute Javascript so it won't work on all of the new Web 2.0 sites.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;...use greasemonkey?&lt;/span&gt;  Because everyone hates Javascript :-)!!  Seriously, because you can spawn multiple threads in your Python program (however, only the main thread can "touch" the browser).  Because you have access to the incredibly rich set of Python libraries.  Because Python has a real console and debugger.  Greasemonkey is a toy to markup web pages.  A very cool toy of course!  But still your program will always be limited in complexity by inherent Javascript limitations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-2686454039998006110?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/2686454039998006110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/01/browser-hacking.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2686454039998006110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2686454039998006110'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2010/01/browser-hacking.html' title='Browser Hacking'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-5332677133317853401</id><published>2009-10-09T13:28:00.000-07:00</published><updated>2009-10-09T13:42:03.507-07:00</updated><title type='text'>A well deserved plug</title><content type='html'>I did not populate my Lightuino LED board with excessive LEDs.  In retrospect, that is kind of ironic.  But the board is made for you to put the light where YOU want it to go :-).&lt;br /&gt;&lt;br /&gt;In particular I left off the TX and RX LEDs so you can't tell if it's downloading the sketch.  But it does have power and the pin 13 LED.  So... I decided to hack the bootloader to blink the pin 13 LED as the sketch comes down.  Well guess what!  &lt;a href="http://www.wulfden.org/TheShoppe/freeduino/ADABOOT.shtml"&gt;Its already been done!&lt;/a&gt;  And it worked flawlessly, without me even having to do a compile.&lt;br /&gt;&lt;br /&gt;Thank you LadyAda and Brian!  These are people who are building the community, not just selling knockoffs.  So I say, if she stocks it &lt;a href="http://www.adafruit.com/"&gt;here&lt;/a&gt; or he stocks it &lt;a href="http://www.wulfden.org/TheShoppe/freeduino/index.shtml"&gt;there&lt;/a&gt; then buy it from them!&lt;br /&gt;&lt;br /&gt;[Disclamer: My only affiliation is as a satisfied customer of adafruit -- I use her USBtinyISP and the Boarduino]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-5332677133317853401?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/5332677133317853401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/10/well-deserved-plug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5332677133317853401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5332677133317853401'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/10/well-deserved-plug.html' title='A well deserved plug'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-1015532678426520109</id><published>2009-10-06T19:16:00.000-07:00</published><updated>2009-10-07T16:29:12.533-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Lightuino'/><category scheme='http://www.blogger.com/atom/ns#' term='LED'/><category scheme='http://www.blogger.com/atom/ns#' term='Rainbowduino'/><category scheme='http://www.blogger.com/atom/ns#' term='Arduino'/><title type='text'>Lightuino Design Thoughts</title><content type='html'>&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/PkfU6xXRHKqQtvgnRSrsKw?feat=embedwebsite"&gt;&lt;img src="http://lh3.ggpht.com/_XQ0vbXkszcw/SsfoNBTjjRI/AAAAAAAAAQc/wUqFRy0k6uk/s400/p1010013.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/G.Andrew.Stone/References?feat=embedwebsite"&gt;references&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;In designing the Lightuino I wanted to improve on my existing CCShield in several ways and provide an alternative to the Rainbowduino (which is also an Arduino compatible LED display board).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;New Features!&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;NOT (necessarily) a shield!&lt;/h3&gt;&lt;br /&gt;The biggest change is the addition of the ATMEGA CPU, clock, etc logic, making the Lightuino a standalone board!&lt;br /&gt;&lt;br /&gt;Of course, you can still use it as a shield, either WITH the ATMEGA populated or WITHOUT (if the ATMEGA is not populated, it MUST be used as a shield of course).  And you can stack them.  If it is stacked, it ought to let you do some really interesting distributed computing stuff.&lt;br /&gt;&lt;br /&gt;By integrating the ATMEGA on-board, the total cost is a lot less, since you don't need the Arduino board.  And its a lot smaller too!&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Separate LED power Regulator&lt;/h3&gt;&lt;br /&gt;An LM317T was added to the board, with a 10k adjustable POT, so you can deliver consistent power to the LEDs (or to whatever) even if your wall-wart is unregulated.  As long as your wall-wart provides the voltage, you can go up to 30+ volts, allowing each CCShield sink to control a string of LEDs.  However the M5451 chips can only handle a 13 volt differential, so you must make sure that the voltage has dropped down to this before it enters the chip.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;IDE cable headers&lt;/h3&gt;&lt;br /&gt;If you are stacking Lightuinos, the IDE cable header does not quite fit in a stack, so right angle headers are available.&lt;br /&gt;&lt;br /&gt;The IDE cable pinout was also changed to put all of the power lines on one end, and to NOT provide a ground line unless a jumper is inserted on the board.  Additionally, the pinout is the same on both sides (instead of upside down).  This makes it a lot easier to wire up the LEDs AND also makes it very difficult to accidently burn out a LED by wiring it up to ground (for example) instead of to a current sink.&lt;br /&gt;&lt;br /&gt;Finally, one of the lines is unassigned, and accessible via a pin on the board.  So you can push whatever signal out that you want!&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Pin Selection&lt;/h3&gt;&lt;br /&gt;Just like the CCShield, you can select whatever Arduino (digital) pins you want to control the LED portion of the board.  But the CCShield's pin selection was difficult as it used extremely small SMT pads.  The Lightuino simply has a section of the board with some thru-holes and you use jumper wires to make the selection.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Brightness Adjustment&lt;/h3&gt;&lt;br /&gt;It turns out that the M5451 chips can drive the LEDs at a barely discernible difference in brightness, so trim pots were added to the brightness adjustment to allow you to make the chips output the exact same light intensity (or actually, you could make one chip output bright, and one dim).  Of course, this can be simply populated with resistors to save $ if exact brightness levels are not needed.  It is unlikely that these will be needed for casual use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Extras&lt;/h3&gt;&lt;br /&gt;The ATMEGA 328 QFN package has 2 additional analog inputs, so I brought those out by simply extending the Arduino standard pinout.&lt;br /&gt;&lt;br /&gt;Also, I had extra space so I threw in the footprint of a voltage divider per analog input pin since that is a very common circuit.  Just add your own resistors, and you are all set!&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Comparison with Rainbowduino&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;Matrix?&lt;/h3&gt;&lt;br /&gt;Let me start by saying that I don't have a Rainbowduino, so this is all conjecture from reading the specs. It seems to me that it was mostly focused on driving an RGB 8x8 LED matrix display.  In fact you can even plug a matrix directly into it.  I was more interested in driving individually placed LEDs for art projects.  While LED matrices are cool and have their uses in signage, frankly, if I wanted a big screen I'd just buy a flat screen TV!  But whatever floats your boat. :-)&lt;br /&gt;&lt;br /&gt;Of course, you can always use a LED matrix electrical connection, but not have the LEDs in a grid, but it is trickier to do that wiring... additionally you can use the Lightuino to "sink" the columns of an matrix (70 columns instead of just 24!)... but you would need to power the rows with some other circuitry.  So again, its trickier :-).&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Shield Compatiblitity&lt;/h3&gt;&lt;br /&gt;Additionally, the Rainbowduino does not seem to be Arduino shield compatible.  This seemed to me to be a major drawback as it does not take advantage of the vast community of shields out there that can add so many cool features to a project!&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;CPU Power&lt;/h3&gt;&lt;br /&gt;The ATMEGA 168 is pretty limited in RAM, as I found when working with the normal Arduino, so I moved up to the 328 with double the RAM.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;LED Capability&lt;/h3&gt;&lt;br /&gt;I opted for 2 chips that can drive 70 constant currents outputs at 20mA, the Rainbowduino allows you to drive fewer outputs (24) at higher capacity (120mA).&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;PWM Dimming&lt;/h3&gt;&lt;br /&gt;I wanted to experiment with POV art (i.e. a light strip that forms an image floating in space when your eyes flick by it, or spinning a strip to form in image in a circle) and to do that you need precise control of when the LEDs are ON vs OFF.  In other words, a separate PWM chip won't work.  However, this means that the Lightuino has to drive PWM in software, just like what the Arduino's PWM pins do.  At very low PWM levels (say 10 on out of 256 counts) you can perceive the LED blinking (and of course more Arduino processor time is used).  Therefore, you end up with another tradeoff, precise control over the blinking of each LED verses faster blink rates (note, I'm just assuming the Rainbowduino has an external PWM, but I haven't verified that).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-1015532678426520109?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/1015532678426520109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/10/lightuino-design-thoughts.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1015532678426520109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/1015532678426520109'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/10/lightuino-design-thoughts.html' title='Lightuino Design Thoughts'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_XQ0vbXkszcw/SsfoNBTjjRI/AAAAAAAAAQc/wUqFRy0k6uk/s72-c/p1010013.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-275679709233863101</id><published>2009-10-03T17:33:00.001-07:00</published><updated>2009-10-15T09:15:42.534-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='toaster oven soldering'/><category scheme='http://www.blogger.com/atom/ns#' term='Lightuino'/><category scheme='http://www.blogger.com/atom/ns#' term='CCShield'/><category scheme='http://www.blogger.com/atom/ns#' term='SMT soldering'/><category scheme='http://www.blogger.com/atom/ns#' term='Arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='M5451'/><title type='text'>Lightuino V2.0 -- An Arduino compatible optimized for driving LEDs</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XQ0vbXkszcw/Ssge_Ppf4lI/AAAAAAAAARA/V2CbfqDoAsQ/s1600-h/p1010009+%28Modified%29.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 179px;" src="http://2.bp.blogspot.com/_XQ0vbXkszcw/Ssge_Ppf4lI/AAAAAAAAARA/V2CbfqDoAsQ/s320/p1010009+%28Modified%29.jpg" alt="" id="BLOGGER_PHOTO_ID_5388591026029978194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The CCShield board was pretty successful and I had a lot of fun with it, so I decided to do another run.  I wanted to attempt some surface mount work but at the same time not produce a lemon if it did not work, so I created the hybrid board you see above.  The board has a complete Arduino-compatible subsection on it implemented using surface mount parts and the CCShield (plus some extra goodies) implemented using thru-hole parts.  The idea is that the board can be used as a shield if the surface mount parts are not populated, or used standalone if the parts are.&lt;br /&gt;&lt;br /&gt;Another cool feature is that you can stack them -- so I can experiment with running a bunch of processors simultaneously.&lt;br /&gt;&lt;br /&gt;I'll be adding a couple of posts about this board.  This first is about building up the surface mount parts.  The image above is the board with the surface mount parts baked on and the minimum thru hole parts added to bring power and the ICSP programmer on.&lt;br /&gt;&lt;br /&gt;I used the smallest part I could find for the CPU, QFN-32 and 0603 parts for the resistors and caps.  The tricky part of the QFN32 package is that the leads are underneath the part, making it hard to repair solder bridges.&lt;br /&gt;&lt;br /&gt;To make my surface mount station, I "rescued" an old toaster oven from the dump and "splurged" on some solder paste, rosin, and wick from dealsextreme &lt;a href="http://www.dealextreme.com/details.dx/sku.4711"&gt;dealextreme&lt;/a&gt;.  Then I bought some .5mm mechanical pencils from Staples, some tweezers from Walgreens.  Total cost about $20.&lt;br /&gt;&lt;br /&gt;This supplemented my current thru-hole solder station that consists of a plastic clamp (Home Depot) to hold a circuit board, a radio-shack 40 watt soldering iron, and an old a magnifying glass/light on arm combo from the basement (really its the bright light that's important).&lt;br /&gt;&lt;br /&gt;I then used the mechanical pencil to "paint" the solder paste on the leads.  For the QFN part, I just laid the paste across the leads and then used an Exacto-knife to "cut" the spaces between them.  It seems like the biggest pitfall is simply using TOO MUCH PASTE.  You want just the thinnest layer, and do not even cover the entire pad!&lt;br /&gt;&lt;br /&gt;Then I just placed the components in their positions using the tweezers, and did fine adjustment of the QFN32 part with the edge of the tweezers.&lt;br /&gt;&lt;br /&gt;Baking was easy.  I followed the temperature profile &lt;a href="http://www.openhardware.net/Misc_Stuff/ToasterSMD/"&gt;here&lt;/a&gt;.  But not really... I used the thermostat on the oven, not a real temperature gauge.  Basically, just set your oven for 170 C put the boards in and wait 3 minutes.  Then raise the temperature to 220 C and shine a bright light in so you can see the boards clearly.  After a minute or two the solder will go from grey to silvery.  Wait another 30 sec to a minute to be sure that ALL the solder has gone silvery.  Then turn off the oven (but leave the boards in there) and crack open the door.  You want to cool the boards evenly.  After a few minutes, open the door fully, and when they are cool to the touch, pop them out!&lt;br /&gt;&lt;br /&gt;I did 4 boards and had 2 solder bridges on the QFN parts.  Every other part worked without any issues.&lt;br /&gt;&lt;br /&gt;If you have a bridge (you can see it), paint the entire side of the part with a gob of rosin.  Then place your solder wick over all of the leads and heat it all up with a clean iron on top of the wick.  The rosin will help the solder flow and it will either flow onto the pins, or onto your wick.  Easy!&lt;br /&gt;&lt;br /&gt;So if you are a DIYer who has been leery of using SMT parts, I'd say "go for it"!&lt;br /&gt;&lt;br /&gt;[edit oct 15, 2009:  I just did 12 successful boards without any solder bridges.  Mix 50/50 paste and flux so the result is viscous like maple syrup]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-275679709233863101?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/275679709233863101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/10/lightuino-v20-arduino-compatible.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/275679709233863101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/275679709233863101'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/10/lightuino-v20-arduino-compatible.html' title='Lightuino V2.0 -- An Arduino compatible optimized for driving LEDs'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XQ0vbXkszcw/Ssge_Ppf4lI/AAAAAAAAARA/V2CbfqDoAsQ/s72-c/p1010009+%28Modified%29.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-5386606237652457655</id><published>2009-09-11T12:14:00.000-07:00</published><updated>2009-09-11T13:23:25.946-07:00</updated><title type='text'>Solar Powered Arduino</title><content type='html'>I am working on an outdoor LED coffee table.  The idea is for it to charge up all day long and then to drive a bunch of LEDs (blinking in cool patterns via an Arduino) for as long as it has power at night.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XQ0vbXkszcw/SqqmKOICsdI/AAAAAAAAAQE/8IPzkb7qnVM/s1600-h/solarPoweredArduinoProto.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:right;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_XQ0vbXkszcw/SqqmKOICsdI/AAAAAAAAAQE/8IPzkb7qnVM/s320/solarPoweredArduinoProto.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5380295399368208850" /&gt;&lt;/a&gt;&lt;br /&gt;There are 5 components to the electronics:&lt;br /&gt;&lt;small&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;The Arduino&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The LED driver&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Solar Cells&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Battery pack&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Charging/light sensor circuit&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;In the photo, clockwise from the top left are the solarcells, the battery, the charging circuit and finally the Arduino (actually a &lt;a href="http://www.ladyada.net/make/boarduino/"&gt;boarduino&lt;/a&gt;), LEDs, and LED driver chip.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style="font-weight:bold;"&gt;The Solar Cells&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;I chose some flexible solar cells I had lying around from &lt;br /&gt;&lt;a href=http://www.flexsolarcells.com/index_files/OEM_Components/Flex_Cells/pages/Flex_Cells_Individual_11_MP72_75.php&gt;www.flexsolarcells.com&lt;/a&gt;.  It turned out that they are a great choice for generic Arduino use because a single thin film cell generates 7.2 volts which is enough to power an Arduino!  In contrast, one of the silicon cells only produces .5 volts (you need from 4.5 to 5.5 volts to power an Arduino).  &lt;br /&gt;&lt;br /&gt;In fact just one of the cells pictured here can power the arduino even in the shade.  You could image one of these on top of a small device... however, they are not ideal for my project because I will have plenty of room under the glass of my table to put a lot of cells.  And the silicon cells are cheaper per watt and more efficient per unit area.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Batteries&lt;/h2&gt;&lt;br /&gt;I chose 4 1.2 volt Nmh (nickel-metal-hydride) batteries.  I chose Nmh batteries because they can be trickle charged with a very simple circuit.  They actually generate 1.3 (5.2 total) volts when fully charged.  But that is less then the Arduino's limit of 5.5 volts, so I can connect directly to the Arduino's 5v line instead of the Vin.  This bypasses the Arduino's voltage regulator and so is much more efficient but a little dangerous.  It for some reason the voltage ever does exceed 5.5 volts, I could burn out the chip.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Charging Circuit&lt;/h2&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XQ0vbXkszcw/SqqqMQbkbmI/AAAAAAAAAQM/_G0lSnJqrNQ/s1600-h/ArduinoSolarChargerSchematic.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://2.bp.blogspot.com/_XQ0vbXkszcw/SqqqMQbkbmI/AAAAAAAAAQM/_G0lSnJqrNQ/s320/ArduinoSolarChargerSchematic.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5380299832393231970" /&gt;&lt;/a&gt;&lt;br /&gt;Basically, when the battery voltage is above that generated by the solar cells, current can flow from the top through the base (middle) of the upper right transistor and then backwards through the solar cells.  This turns on the transistor, which then turns on the bigger transistor at the bottom and so power can flow through the Arduino.  So the solar cells themselves are used both to charge and to sense when it gets dark.  In practice, they turn the system on at dusk, so I put the Arduino to sleep for 45 minutes before actually turning on the LEDs.&lt;br /&gt;&lt;br /&gt;The diode near the solar cells is so cells can only charge the battery, the battery can't attempt to "charge" the cells!&lt;br /&gt;&lt;br /&gt;And finally a close up of the charging circuit itself:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XQ0vbXkszcw/SqqsTuzpPgI/AAAAAAAAAQU/IJ1nuCpvsJA/s1600-h/chargerCircuitCloseup.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_XQ0vbXkszcw/SqqsTuzpPgI/AAAAAAAAAQU/IJ1nuCpvsJA/s320/chargerCircuitCloseup.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5380302159829614082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The orange wires to the left go to the Arduino.  The upper right ones go to the battery and the lower right to the cells.  The wires on the bottom of the photo are basically electrical ground.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The LEDs&lt;/h2&gt;&lt;br /&gt;I use an M5451 constant-current LED driver chip to light the LEDs.  If you are interested in this, there is a lot more information in prior blog posts, or at: &lt;a href="http://code.google.com/p/arduino-m5451-current-driver/"&gt;http://code.google.com/p/arduino-m5451-current-driver/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Share your solar projects! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-5386606237652457655?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/5386606237652457655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/09/solar-powered-arduino.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5386606237652457655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/5386606237652457655'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/09/solar-powered-arduino.html' title='Solar Powered Arduino'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XQ0vbXkszcw/SqqmKOICsdI/AAAAAAAAAQE/8IPzkb7qnVM/s72-c/solarPoweredArduinoProto.JPG' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-8574364983026068818</id><published>2009-07-07T12:27:00.000-07:00</published><updated>2009-07-07T13:25:07.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sensor networks'/><category scheme='http://www.blogger.com/atom/ns#' term='cooperative robotics'/><category scheme='http://www.blogger.com/atom/ns#' term='Arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='CPLD'/><category scheme='http://www.blogger.com/atom/ns#' term='reconfigurable hardware'/><title type='text'>Arduino + wireless + reconfigurable hardware: A proposal</title><content type='html'>I am thinking about doing a quadruple whammy Arduino board: Atmel Mega 640 + CPLD + wireless + MicroSD card. &lt;br /&gt;&lt;br /&gt;For those of you who are unfamiliar with the term "CPLD", it is a reconfigurable hardware chip.  Essentially, today's CPUs all follow what is called the "von Neumann architecture" in which a CPU executes a set of instructions in a sequential fashion.  A CPLD is very different.  It is a "sea of logic gates", so it essentially executes every instruction simultaneously.  So if you visualize a plot with the horizontal axis being what can be done per unit time, and the vertical being how much time to do a task, the CPU plot looks long and thin.  It can't DO much per unit time, but you can string together many instructions to do complex tasks.  The CPLD plot looks short and fat.  It can DO a lot per unit time, but cannot do complex tasks since tasks must be completed in essentially 1 time unit.  CPUs are much more well known both because they are programmed in a manner more intuitive to people and because ultimately you can get a lot more done with a CPU.  However, their linear nature means that there are things that CPUs do not do well, like simultaneously and monitoring rapidly fluctuating inputs.&lt;br /&gt;&lt;br /&gt;The reasoning behind integrating a wireless network and MicroSD is much simpler.  First of all, the MicroSD card has a very simple interface (8 wires) so its easy to plop down and very useful for data recording, etc.  Its so simple there is no reason to NOT integrate it.  Purchased separately, a wireless network is expensive.  You must buy a shield ($20-30) and a wireless module (another $20-$30).  So this ends up being an additional $40-$60, not that expensive until you consider that the most interesting uses are to have not just one or 2 devices but to have a "cloud" of them.  So for 10 devices, that would cost $500 -- outside of the casual hobbyiest budget.  However the basic wireless chips cost about $4 for single quantities, and maybe $5 when the few additional parts are added.  So an integrated wireless would cost an extra $50. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It seems to me that once you leave thru-hole chipsets, the casual user can't just plop the AVR down on his own handwired circuit board... but if people are OK with that (and it seems like they are given how many other surface mount Arduino clones exist), then it really opens the door for a base platform that hits key features that the Arduino is missing today.  If the chips are integrated into the base platform, this platform becomes MUCH cheaper and smaller then buying all the shields separately.  The final result is a tiny computer with the all the essential components of a "standard" PC (CPU, network, disk) AND the components required for a high performance/high IO embedded device (CPLD running at 100mhz with 50+ digital IOs).  This combination can be used for sensor networks, cooperative mini-robotics, illumination, art/design projects etc and would probably cost around $50 or less.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-8574364983026068818?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/8574364983026068818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/07/arduino-cpld-reconfigurable-hardware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/8574364983026068818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/8574364983026068818'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/07/arduino-cpld-reconfigurable-hardware.html' title='Arduino + wireless + reconfigurable hardware: A proposal'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-6089076182193845046</id><published>2009-03-24T12:10:00.000-07:00</published><updated>2009-03-24T12:51:43.357-07:00</updated><title type='text'>Thoughts on GPL, the Open Company concept, and making $ therein</title><content type='html'>One aspect of the philosophy of GPL is to contribute back to the community.  However, as we all know in the GPL license the only way to contribute is by submitting code.&lt;br /&gt;&lt;br /&gt;This creates several problems; the primary being a chasm between it and all other economic activity.  This has resulted in lots of people coming up with very creative but ultimately ancillary ways to fund GPL activity, the primary being support.  There is probably a mountain of literature written about this and so I won't go into them more deeply here other than to summarize:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;These methods are not satisfactory because the effort/reward relationship is obscure at best and at worst rewards the wrong activities.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So let us modify the GPL with a economic clause.  This would essentially state, "If you want to use this software without licensing your derivative software via GPL, then simply pay us money.&lt;br /&gt;&lt;br /&gt;In this way a company or individual can contribute back to the project in the traditional ($) manner (as an aside, does it also allow code contributions to be valued monetarily and therefore taxed?).   But of course what should the project do with that cash?  While many projects could definitely use the money to pay for server space and bandwidth; we can imagine an extremely successful piece of OSS that is actually generating a surplus of money.  It would obviously be inappropriate for the project founder to keep it since in theory the software has benefited from submissions from many individuals.&lt;br /&gt;&lt;br /&gt;That observation cannot sit in anyone's mind without producing the obvious answer within a modern meritocracy:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Project surplus should be distributed to individuals according to level of contribution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the project is successful, one might imagine that this could become key contributors primary source of income.  Essentially they would be "employees" of the project's "company", but without some of the pain associated with corporate involvement (and perhaps also without some of the benefits).&lt;br /&gt;&lt;br /&gt;Of course, this brushes all kinds of issues under the rug such as how to measure "level of contribution".  Let me throw out an initial breakdown formula:&lt;br /&gt;&lt;br /&gt;contribution = "Trust Network" opinion * (alpha * sum(cool feature values) + beta * lines of code + delta * sum(bug fix value) - epsilon*(sum bugs you created))&lt;br /&gt;&lt;br /&gt;"Trust Network opinion" = how other people rate you; used to catch people who are padding out their contributions by writing wordy code, etc.&lt;br /&gt;&lt;br /&gt;Alpha, beta, and delta = arbitrary weighting factors depending on what's most important.&lt;br /&gt;&lt;br /&gt;"cool feature values" = How much people like the feature you added (or maybe real-time feedback reporting what features the users are using)&lt;br /&gt;&lt;br /&gt;"lines of code" should be obvious&lt;br /&gt;&lt;br /&gt;"bug fixes" = Fixing bugs is a boring nasty job but someone has to do it.&lt;br /&gt;&lt;br /&gt;And of course your contribution should be penalized by the # of bugs found; after all, if someone has to essentially rewrite your stuff; I'm not sure if you deserve too much credit.&lt;br /&gt;&lt;br /&gt;But this only focuses on the code.  How about the community?  We can imagine similar metrics created for support forums; # of posts, response time, quality of posts, etc, and combined into a monster "value" equation.  And documentation...&lt;br /&gt;&lt;br /&gt;Even the necessary evil of "hierarchy and planning" can perhaps be captured by a pyramid scheme whereby section owners "contribution value" includes a tiny % of all contribution values to that section.&lt;br /&gt;&lt;br /&gt;All of this begs the question: "Is it possible to capture all business activities?"  To create an "Open Company?"&lt;br /&gt;&lt;br /&gt;All of the above are my own ideas except for the word "Open Company".  I was inspired to blog about them today because I think we are about to take the initial steps in regard to feasibility;  there is a company out there who is going to try to do just that.&lt;br /&gt;&lt;br /&gt;You can read a bit about it at:  http://e-texteditor.com/blog/2009/opencompany&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-6089076182193845046?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/6089076182193845046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/03/thoughts-on-gpl-open-company-concept.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6089076182193845046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6089076182193845046'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/03/thoughts-on-gpl-open-company-concept.html' title='Thoughts on GPL, the Open Company concept, and making $ therein'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-9023932010618259371</id><published>2009-03-11T06:46:00.000-07:00</published><updated>2009-04-02T17:48:28.994-07:00</updated><title type='text'>Arduino L298 stepper motor driver</title><content type='html'>Here is an example Arduino sketch to drive a stepper motor using the L298 chip.  The actual driver is the "StepperL298N" class, and then there is some code to test it.  When you instantiate the class, pass in the 4 Arduino pins that you have connected to the stepper motor.  For example, "StepperL298N motor(4,5,6,7)" will drive a motor connected to Arduino pins 4,5,6,7.  If you need to drive 2 motors, just create 2 instances of the class with different pins!&lt;br /&gt;&lt;br /&gt;To move the motor 1 tick, call the step(bool direction) member function.  Call it with 1 to go forward, and 0 to go backwards.  The faster you call it, the faster the motor will go.  Note that the Arduino can easily call step() much faster than the motor can possibly be driven, so you must insert a delay by calling the delay function.  For my test motor (and old AMP 2.3 volt 60oz*in, which I got from taking apart a printer) you have to delay at least 5ms for the motor to work.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt; * stepperL298N&lt;br /&gt; * Copyright 2008 G. Andrew Stone&lt;br /&gt; * Licensed under the Common Public License V1.0&lt;br /&gt; * For the full text of this license see: http://www.opensource.org/licenses/cpl1.0.php&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;int ledPin = 13;&lt;br /&gt;&lt;br /&gt;void setup()                    // run once, when the sketch starts&lt;br /&gt;{&lt;br /&gt;  pinMode(ledPin, OUTPUT);      // sets the digital pin as output&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void mydelay(int clk)&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt;  for (i=0;i&lt; clk;i++);&lt;br /&gt;  //delay(clk);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class StepperL298N&lt;br /&gt;{&lt;br /&gt;  public:&lt;br /&gt;  byte pins[4];&lt;br /&gt;  byte curState;&lt;br /&gt;  byte* lut;&lt;br /&gt;  StepperL298N(byte pin1,byte pin2,byte pin3,byte pin4);&lt;br /&gt;     &lt;br /&gt;  void step(boolean dir);&lt;br /&gt;  void halfStep(boolean yes) { if (yes) lut = halfStepLut; else lut = fullStepLut;}&lt;br /&gt;  void start() { curState = 0xa;}&lt;br /&gt;  void free() { curState = 0; }&lt;br /&gt;  void brake() { curState = 0; }&lt;br /&gt;&lt;br /&gt;  byte fullStepLut[16];&lt;br /&gt;  byte halfStepLut[16];&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StepperL298N::StepperL298N(byte pin1,byte pin2,byte pin3,byte pin4)&lt;br /&gt;{&lt;br /&gt;  pins[0] = pin1; pins[1] = pin2; pins[2]=pin3; pins[3] = pin4;&lt;br /&gt;  lut = fullStepLut;&lt;br /&gt;  for (int i=0;i&lt;4;i++)&lt;br /&gt;    {&lt;br /&gt;    pinMode(pins[i], OUTPUT);      // sets the digital pin as output&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt; memset(&amp;fullStepLut,sizeof(byte)*16,0);&lt;br /&gt; memset(&amp;halfStepLut,sizeof(byte)*16,0);&lt;br /&gt;&lt;br /&gt; // High nibble goes one way, low the other&lt;br /&gt; fullStepLut[0] = 0;&lt;br /&gt; // 1010 -&gt; 1001 -&gt; 0101 -&gt; 0110&lt;br /&gt; fullStepLut[0xa] = 0x9 | 0x60;&lt;br /&gt; fullStepLut[0x9] = 0x5 | 0xa0;&lt;br /&gt; fullStepLut[0x5] = 0x6 | 0x90;&lt;br /&gt; fullStepLut[0x6] = 0xa | 0x50;&lt;br /&gt;&lt;br /&gt; halfStepLut[0] = 0;&lt;br /&gt; // 1010 -&gt; 1000 -&gt; 1001 -&gt; 0001 -&gt; 0101 -&gt; 0100 -&gt; 0110 -&gt; 0010&lt;br /&gt; halfStepLut[0xa] = 0x8 | 0x20;&lt;br /&gt; halfStepLut[0x8] = 0x9 | 0xa0;&lt;br /&gt; halfStepLut[0x9] = 0x1 | 0x80;&lt;br /&gt; halfStepLut[0x1] = 0x5 | 0x90;&lt;br /&gt; halfStepLut[0x5] = 0x4 | 0x10;&lt;br /&gt; halfStepLut[0x4] = 0x6 | 0x50;&lt;br /&gt; halfStepLut[0x6] = 0x2 | 0x40;&lt;br /&gt; halfStepLut[0x2] = 0xa | 0x60;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void StepperL298N::step(boolean dir)&lt;br /&gt;{&lt;br /&gt;  curState = lut[curState];&lt;br /&gt;  if (dir) curState &amp;= 0xf;&lt;br /&gt;  else curState &gt;&gt;= 4;&lt;br /&gt;  for (int i=1,j=0;i&lt; 16;i*= 2,j++)&lt;br /&gt;    {&lt;br /&gt;    byte lvl = LOW;&lt;br /&gt;    if (i&amp;curState) lvl=HIGH;&lt;br /&gt;    digitalWrite(pins[j],lvl);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int serDataVal = LOW;&lt;br /&gt;void loop()                     // run over and over again&lt;br /&gt;{&lt;br /&gt;  unsigned long int j;&lt;br /&gt; &lt;br /&gt;  StepperL298N motor(3,4,5,6);&lt;br /&gt;  motor.halfStep(true);&lt;br /&gt;  motor.start();&lt;br /&gt;&lt;br /&gt;  for (j=0;j&lt; 1000;j++)&lt;br /&gt;    {&lt;br /&gt;    motor.step(1);&lt;br /&gt;    digitalWrite(ledPin, j&amp;1);   // sets the LED on&lt;br /&gt;    delay(5+j/10);  // Change the delay to change the rate the motor spins&lt;br /&gt;    }&lt;br /&gt;  motor.halfStep(false);&lt;br /&gt;  motor.start();&lt;br /&gt;  for (j=0;j&lt; 1000;j++)&lt;br /&gt;    {&lt;br /&gt;    motor.step(0);&lt;br /&gt;    digitalWrite(ledPin, j&amp;1);   // sets the LED on&lt;br /&gt;    delay(5+j/10);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Michael Margolis ('mem' on the Arduino.cc forum) was kind enough to let me cross-post a schematic:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XQ0vbXkszcw/SdVceUCy49I/AAAAAAAAANU/dsFHH2hmaCI/s1600-h/arduino+L298+schematic.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 226px;" src="http://3.bp.blogspot.com/_XQ0vbXkszcw/SdVceUCy49I/AAAAAAAAANU/dsFHH2hmaCI/s320/arduino+L298+schematic.jpg" alt="" id="BLOGGER_PHOTO_ID_5320260210654372818" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-9023932010618259371?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/9023932010618259371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/03/arduino-l298-stepper-motor-driver.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/9023932010618259371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/9023932010618259371'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/03/arduino-l298-stepper-motor-driver.html' title='Arduino L298 stepper motor driver'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XQ0vbXkszcw/SdVceUCy49I/AAAAAAAAANU/dsFHH2hmaCI/s72-c/arduino+L298+schematic.jpg' height='72' width='72'/><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-7195678773734165447</id><published>2009-02-28T07:06:00.000-08:00</published><updated>2009-02-28T08:31:58.370-08:00</updated><title type='text'>GUI Design and click-distance</title><content type='html'>I am not a GUI designer by trade, but I have done some GUI design both of web applications and normal GUIs.  And I'd like to both rant a little and describe some of my GUI design thoughts.&lt;br /&gt;&lt;br /&gt;First I think that we can all agree that many GUIs are poorly designed and therefore frustrating to use.  And a lot has been written about how to clearly lay out information on the page, etc.  A good layout is alway good, but especially for new users to the system.  But what about the other 99% of the time the user uses the system?  Once the user understands your GUI, how long it takes to physically move the mouse across the screen to use each widget required to get the job done becomes the determining factor as to whether your GUI is useable or not.&lt;br /&gt;&lt;br /&gt;A lot less (if anything -- I can't find anything but I certainly haven't done a lit review on this!) has been written this -- about the kinematics of web design.&lt;br /&gt;&lt;br /&gt;Wikipedia defines &lt;a href="http://en.wikipedia.org/wiki/Kinematics"&gt;kinematics&lt;/a&gt; as studying motion without considering the circumstances leading to that motion.  That is very similar to what I want to talk about -- which is the motion of the user's hands as he moves the mouse, moves from the mouse to the keyboard and so on.  It doesn't really matter what the purpose of this motion is, other than to observe that good GUI design should attempt to minimize or eliminate the motion for common tasks.&lt;br /&gt;&lt;br /&gt;Let me suggest a new metric called "click-distance".  The purpose of click-distance is to create a quantitive measurement of how "far" the user has to move from his current GUI-state to get to his desired GUI state.  So the metric will contain a lot more components then just clicking and moving the mouse, but I think that the term "click-distance" implies a good first order approximation. &lt;br /&gt;&lt;br /&gt;One think that I don't like about the term is that perhaps even more important as "click-distance" is "click-time".  That is, how long did it take to traverse the click-distance?  But I think that "click-time" itself is not as important as "click-frustration" or how PISSED the user gets because he has to do something like individually select 500 files in 500 upload file dialog boxes instead of shift-clicking them all at once.  But the further we go down this path, the less measurable the metric becomes.&lt;br /&gt;&lt;br /&gt;Clearly by recording the sequence of input the user makes, we can infer something about the distance the user's hands travelled given a particular physical setup (desktop, laptop, or PDA/phone).  And don't forget about left-handed people!&lt;br /&gt;&lt;br /&gt;Click-distance should capture the following concepts.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Literal distance metrics:&lt;br /&gt;&lt;br /&gt;1. Total distance the mouse cursor moved.  Obvious!&lt;br /&gt;2. Number of mouse-repositions.  A person can move halfway across the screen in almost the time it takes to move just a little way.  From experimenting on myself, it seems to take around a second for each individual mouse motion.&lt;br /&gt;3. Number of uninterrupted mouse direction changes.  A person generally moves the mouse in a straight line from its current position to the desired destination.  If the mouse moves back and forth or around and around, that implies difficulty positioning -- that is, the GUI element is too small.  From your high school calculus we know that the direction is changing along a particular axis when the velocity is zero...&lt;br /&gt;&lt;br /&gt;Button press metrics:&lt;br /&gt;&lt;br /&gt;4. Number of clicks and keys pressed.&lt;br /&gt;5. Number of alternations between mouse press and key press.  This metric is a rough estimate of how many times the user had to move his hand from the mouse to the keyboard, and is therefore a major contribution to click distance&lt;br /&gt;6. ctrl-alt-shift-click Combinations.&lt;br /&gt;&lt;br /&gt;Hard to measure metrics:&lt;br /&gt;&lt;br /&gt;6. How often a certain sequence is repeated.  Repetition is a huge source of user frustration  (and is the source of carpel-tunnel syndrome) but conveniently is often the easiest to remove through a bit of GUI redesign.  I think that it is so important that click-distance should be the square of the repetition, but only proportional to the rest of the metrics.  However, it is difficult to programatically identify repetitive movements...&lt;br /&gt;&lt;br /&gt;To make a quantitive formula, each of the terms described above should be multiplied by a constant adjustment factor that reflects the distance the hand must move.  These constants might differ based on the physical layout being considered:&lt;br /&gt;&lt;br /&gt;click-distance = A*mouseDist + B*mouseRepos + C*mouseVelZero + D*presses + E*mouseKeyAlternations + F*keyClickCombinations + (G*repetitions)^2&lt;br /&gt;&lt;br /&gt;The idea is of course to mininize this click-distance for common tasks.  Of course, you wouldn't really have to DO this math,  just start thinking about your GUI in terms of how long it takes to do an operation and you'll be well along the path to good, useable design.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are some practical ideas that have emerged from my consideration of click-distance in GUI designs:&lt;br /&gt;&lt;br /&gt;1. No modal dialog boxes!&lt;br /&gt;They force the user to move the hand to the mouse, reposition, and click.  For all "alerts", "errors", etc, use a "message bar" (preferably NOT hidden on the bottom of the screen) and graphics (like red text and animation) to draw attention.&lt;br /&gt;&lt;br /&gt;They also position themselves "creatively" -- aka NOT where your mouse is!&lt;br /&gt;&lt;br /&gt;Using a modal dialog box makes it hard to see the information behind it.&lt;br /&gt;&lt;br /&gt;Does not scale: doing 200 operations that contain a modal dialog requires 200 reposition-click-reposition operations.&lt;br /&gt;&lt;br /&gt;The only time a modal dialog should be used is in TRUELY irrevocable operations.  Like formatting your hard drive.&lt;br /&gt;&lt;br /&gt;Of course, the corrolary to this is that your program should not HAVE any truely irrevocable operations.&lt;br /&gt;&lt;span id="query" class="query"&gt;&lt;/span&gt;&lt;br /&gt;2. Keep it all in one window.&lt;br /&gt;Use tabs, etc.  They much shorter in mouse distance to switch between than windows that have to be sized and positioned.&lt;br /&gt;&lt;br /&gt;3. Design with REAL data, not your unit-test toys.&lt;br /&gt;You really ought to try the GUI with real-world examples, that contain lots of data.  Doing so is the best way to discover repetition.&lt;br /&gt;&lt;br /&gt;4. Allow multi-select absolutely whenever possible.&lt;br /&gt;Creatively apply what this might mean in cases where you are not sure... implementing one of 3 possibilities at least fixed 1/3 of the problem...&lt;br /&gt;&lt;br /&gt;5. Keep values populated in fields, and don't force a history selection from the selection box.&lt;br /&gt;&lt;br /&gt;This will dramatically reduce click-distance for unanticipated repetitive tasks.  Look, this is about click-frustration.  If a person is entering 1000 people's addresses over the whole USA, it is not so bad to type the city and state.  But if the person is the tax accountant for a particular town and so the city and state is almost always the same it can be very tiresome.&lt;br /&gt;&lt;br /&gt;Its best to have an easy way to delete the field in one go like most boxes have.  Or even better try a tiny "pin value" icon button near the field.  If the "pin value" button is depressed, the last value entered is remembered for the next time.&lt;br /&gt;&lt;br /&gt;6. Selection boxes suck!&lt;br /&gt;Clearly the problem is that the user was probably typing, so now he must move from the keyboard to the mouse.  Click to open the selection, all kinds of tricky clicking (especially since the selection box sometimes closes itself if the mouse wanders too far) to scroll down, and finally click to select.  It is major mouse distance.&lt;br /&gt;&lt;br /&gt;Here's one example that would save millions of people 10 seconds per day and massively reduce office rage:&lt;br /&gt;&lt;br /&gt;Its much harder to find "New York" in a list of states 52 states then to just type "NY"!&lt;br /&gt;&lt;br /&gt;Especially when some of you only show us 3 states at a time!&lt;br /&gt;&lt;br /&gt;7. For the prime function, click distance should be &lt;= 1.&lt;br /&gt;&lt;br /&gt;Word processors allow you to add lots of letters to a document with 1 keypress per letter.  They are not so good at saving 10 different copies of the document.  You have to pop up 10 modal dialog boxes.  File managers let you copy 100 documents to 10 different places with a mouse distance of about 20 (1 selection operation + 10*(mouse position + key:ctrl-v)).  And so on...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok.  I think that's enough examples.  There are lots more.  As you think of examples, please add them as comments!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-7195678773734165447?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/7195678773734165447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/gui-design-and-click-distance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/7195678773734165447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/7195678773734165447'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/gui-design-and-click-distance.html' title='GUI Design and click-distance'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-3673036803124903348</id><published>2009-02-27T20:25:00.001-08:00</published><updated>2009-03-14T12:50:34.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Arduino shield'/><category scheme='http://www.blogger.com/atom/ns#' term='LED driver'/><category scheme='http://www.blogger.com/atom/ns#' term='constant current'/><category scheme='http://www.blogger.com/atom/ns#' term='M5451'/><title type='text'>First Arduino shield boards arrived!</title><content type='html'>I designed an Arduino shield to provide a lot of outputs using very few pins on the Arduino... it uses 2 M5451 35 segment LED display driver chips.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XQ0vbXkszcw/SalL2Lto2iI/AAAAAAAAAMU/IqpOtEGxX9I/s1600-h/im1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 237px;" src="http://4.bp.blogspot.com/_XQ0vbXkszcw/SalL2Lto2iI/AAAAAAAAAMU/IqpOtEGxX9I/s320/im1.jpg" alt="" id="BLOGGER_PHOTO_ID_5307857030062070306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's the board with all the parts soldered on.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XQ0vbXkszcw/SalMHe2BDVI/AAAAAAAAAMk/3s65l7vi-xY/s1600-h/im2a.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 203px;" src="http://2.bp.blogspot.com/_XQ0vbXkszcw/SalMHe2BDVI/AAAAAAAAAMk/3s65l7vi-xY/s320/im2a.jpg" alt="" id="BLOGGER_PHOTO_ID_5307857327255260498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Here is a angled view.  On the front you can see a lot of pads.  The idea was to allow the user to choose which Arduino pins should control the board by only bridging some of the gaps.  However it turns out to be very difficult to solder tiny wires across these gaps.&lt;br /&gt;&lt;br /&gt;Any ideas on how to do this better?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XQ0vbXkszcw/Sai9CKY32NI/AAAAAAAAALM/ExvrorzBr5o/s1600-h/P1010001.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_XQ0vbXkszcw/Sai9CKY32NI/AAAAAAAAALM/ExvrorzBr5o/s320/P1010001.JPG" alt="" id="BLOGGER_PHOTO_ID_5307700005702195410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here it is shown lighting up all the LEDs I happened to have lying around.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XQ0vbXkszcw/SalNMgWd9bI/AAAAAAAAAMs/-TJi_C1zba8/s1600-h/P1010002.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_XQ0vbXkszcw/SalNMgWd9bI/AAAAAAAAAMs/-TJi_C1zba8/s320/P1010002.JPG" alt="" id="BLOGGER_PHOTO_ID_5307858513070781874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the bottom view showing the Arduino connected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A youtube video about it:&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/E0D8hDt2M60&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/E0D8hDt2M60&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-3673036803124903348?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/3673036803124903348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/my-first-arduino-shield-arrived.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/3673036803124903348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/3673036803124903348'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/my-first-arduino-shield-arrived.html' title='First Arduino shield boards arrived!'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XQ0vbXkszcw/SalL2Lto2iI/AAAAAAAAAMU/IqpOtEGxX9I/s72-c/im1.jpg' height='72' width='72'/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-6172031139692662256</id><published>2009-02-24T08:19:00.000-08:00</published><updated>2010-07-07T08:20:23.137-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LM334'/><category scheme='http://www.blogger.com/atom/ns#' term='LED driver'/><category scheme='http://www.blogger.com/atom/ns#' term='discovercircuits'/><category scheme='http://www.blogger.com/atom/ns#' term='constant current'/><title type='text'>constant current LED driver thoughts (LM334)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XQ0vbXkszcw/SaQkt7Wd5PI/AAAAAAAAAKs/nflfg5_CuPA/s1600-h/archtiny.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 105px;" src="http://3.bp.blogspot.com/_XQ0vbXkszcw/SaQkt7Wd5PI/AAAAAAAAAKs/nflfg5_CuPA/s320/archtiny.jpg" alt="" id="BLOGGER_PHOTO_ID_5306406632393925874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I was experimenting on how to mount surface mount LEDs in wood and made this little arch to test out ideas.&lt;br /&gt;&lt;br /&gt;All the LEDs are in series.  But the question was how to drive them?  I could connect them to a wall wart transformer and put in a resistor, but that would mean that the resistance of the resistor would have to be tuned to the wall wart transformer.  Since I was just going to grab a transformer from my junk pile of dead electronics I didn't want to do that.  Instead I settled on this constant current circuit shown in discover circuits:&lt;br /&gt;&lt;a href="http://www.discovercircuits.com/DJ-Circuits/constantcurretled1.htm"&gt;&lt;br /&gt;http://www.discovercircuits.com/DJ-Circuits/constantcurretled1.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This circuit is really strange because the current from the LED goes through R1 along with the current from the LM334's current selection. Was it a typo?  Should the LED current really just go straight to ground?&lt;br /&gt;&lt;br /&gt;Also, I popped up the LM334 spec.  The LM334 basically has 3 pins: Positive, ground, and a third "current selection" pin. You just connect a resistor across the current selection pin and the ground pin to choose what current you want.  So it turned out that the LM334 is a constant current driver itself, so why have the extra transistor?&lt;br /&gt;&lt;br /&gt;And In fact, the naked LM334 circuit what I ended up using.  But the issue kept bothering me and so I finally decided to think about it.&lt;br /&gt;&lt;br /&gt;I decided to try 3 simple circuits. Let's call the simple one "A":&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XQ0vbXkszcw/SaQmaWN3NoI/AAAAAAAAAK0/ahNk2obFh2g/s1600-h/LM334a.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 205px; height: 320px;" src="http://3.bp.blogspot.com/_XQ0vbXkszcw/SaQmaWN3NoI/AAAAAAAAAK0/ahNk2obFh2g/s320/LM334a.jpg" alt="" id="BLOGGER_PHOTO_ID_5306408495031465602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So basically the current from the LEDs runs through the LM334, and so, regardless of the input voltage, is regulated by the size of the resistor connected between pins 2 and 3.&lt;br /&gt;&lt;br /&gt;I guess the problem is that all the current is passing through the LM334...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And then a "simplified" discovercircuits, call it "B":&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XQ0vbXkszcw/SaQo7JI-CLI/AAAAAAAAALE/c3AoTbZ6Sps/s1600-h/LM334c.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 248px; height: 320px;" src="http://1.bp.blogspot.com/_XQ0vbXkszcw/SaQo7JI-CLI/AAAAAAAAALE/c3AoTbZ6Sps/s320/LM334c.jpg" alt="" id="BLOGGER_PHOTO_ID_5306411257480218802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The LM334 is used as suggested by the spec.  But the LM334 only controls the current that flows out of the base of the transistor, so current through the transistor and LED will be about 100 times (or whatever the amplification of your transistor is) what is going through the LM334.&lt;br /&gt;&lt;br /&gt;This turns out to be very useful if you want to use the relatively low current LM334 chip to control a much larger current.  Or if you only have larger value transistors lying around.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This one from discovercircuits "C":&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XQ0vbXkszcw/SaQm_GvNhNI/AAAAAAAAAK8/L6Oy0TQS8Rg/s1600-h/LM334b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 270px;" src="http://4.bp.blogspot.com/_XQ0vbXkszcw/SaQm_GvNhNI/AAAAAAAAAK8/L6Oy0TQS8Rg/s320/LM334b.jpg" alt="" id="BLOGGER_PHOTO_ID_5306409126531531986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As I previously said, "C" is really strange because the current from the LED goes through R1 along with the current from the LM334's current selection.&lt;br /&gt;&lt;br /&gt;The LM334 holds is middle pin at 68mV above the bottom.  So without doing any math, you can see that current going through the LED wil have to "share space" through the resistor.  As the current through the LED rises, the current sensed by the LM334 goes down.  This therefore is equivalent (to the LM334) like putting a bigger resistor across its pins.  End result: the LM334 lets a lower current pass through itself (i.e. out of the transistor's base).  You actually end up with a stable situation.&lt;br /&gt;&lt;br /&gt;As with the second circuit (B), the advantage is that load is going through the transistor, not the LM334.  An additional advantage is that the resistor values to make it all work are similar to that in the LM334 spec, and you don't have a 100x multiplication of the current (which may or may not be an advantage)&lt;br /&gt;&lt;br /&gt;Another disadvantage of B is that it is very sensitive to the exact amplification (beta) of the transistor.  But I guess transistor betas used to vary pretty widely within the same part due to small fabrication differences (I am not sure how accurate they are nowadays)... So while B is great for home use where you can test the exact beta of the transistor and choose a resistor to match, this circuit might be a bad idea to use in a production circuit board.&lt;br /&gt;&lt;br /&gt;However, a big disadvantage of C is that the load (from the LED) is going through the resistor, so you do waste more power than in B and most importantly will have to use a high-watt (bulky, expensive, don't have it in your basement) resistor.  Or of course a bunch of normal resistors in parallel...but that is also pretty ugly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-6172031139692662256?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/6172031139692662256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/constant-current-led-driver-thoughts.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6172031139692662256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/6172031139692662256'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/constant-current-led-driver-thoughts.html' title='constant current LED driver thoughts (LM334)'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XQ0vbXkszcw/SaQkt7Wd5PI/AAAAAAAAAKs/nflfg5_CuPA/s72-c/archtiny.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-824114889882641219.post-2540402850732148610</id><published>2009-02-22T12:08:00.000-08:00</published><updated>2009-02-22T14:13:04.699-08:00</updated><title type='text'>Arduino and M5451 -- Control 35 LEDs, motors, etc!</title><content type='html'>I've been fooling around with an Ardunio, which is a small embedded microprocessor and discovered that its a great way for software engineers to learn some hardware engineering.  It is fairly limited in its outputs though, so I bought a couple of M5451 chips (futureelectronics.com MM5451YN for small quantities).  This is nice because it is a 40 pin DIP device that plugs right into a breadboard, and is intended to drive LED displays.&lt;br /&gt;&lt;br /&gt;But it does not HAVE to be used for LED displays -- I'm thinking of it as 35 constant-current switches that can be conveniently controlled (on/off) by 2 Arduino digital pins (clock and serial data).  And if you want to change the current (of all pins) you can use a third pin to connect a "brightness" pin on the 5451 to a PWM on the Arduino.&lt;br /&gt;&lt;br /&gt;So this is a *LOT* cooler than the chips that drive 8x8 arrays of LEDs by strobing them (MAX7219, search for "Arduino 8x8 matrix") because those chips flash the LEDs. So they really can't be used for other applications (like driving motors, or turning on a big-current transistor switch), and the LEDs are in theory not as bright because they are not on the entire time.  In theory, I should be able to drive 2 of these 8x8 matrixes with one M5451 with 3 outputs left over, or one 16x16 (256 LEDS!) display (if I can get my hands on one).&lt;br /&gt;&lt;br /&gt;Also, the cool thing about the M5451 being a constant current driver is that you don't need a current-limiting resistor inline with each LED.  And you can connect several LEDs in series without worrying about V=IR math.  &lt;br /&gt;&lt;br /&gt;But let me emphasize for the beginning hardware DIYer, its important to NOT think of the outputs as logic, just think of them as switches.  Basically you connect the M5451 to ground, and connect your load (let's just use LEDs, for example) between the + and it.  So the M5451 must be on the cathode, minus, ground side -- whatever you call it -- of your LED.  This is IMPORTANT, since if you buy something like RGB LEDs you want to get common ANODE.  Remember, relative to the LED, the anode side is where conventional current (+) goes IN.&lt;br /&gt;&lt;br /&gt;Of course, I bought the common cathode RGB LEDs (*sigh*).&lt;br /&gt;&lt;br /&gt;So here's a picture of a M5451 on a breadboard with a boarduino and with a bunch of LEDs:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XQ0vbXkszcw/SaHDNZFhNwI/AAAAAAAAAKk/TOAJVXotPV0/s1600-h/PICT0005.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_XQ0vbXkszcw/SaHDNZFhNwI/AAAAAAAAAKk/TOAJVXotPV0/s320/PICT0005.JPG" alt="" id="BLOGGER_PHOTO_ID_5305736470858905346" border="0" /&gt;&lt;/a&gt;Ignore the upper part of the breadboard.  all the activity is on the bottom.  Also ignore the square silver chip and transistors on the far right.  That's just stuff hanging around from another project!&lt;br /&gt;&lt;br /&gt;The boarduino is on the bottom left.  The 2 pins used are the green and yellow wires on the top side (the blue and short green wires are just power and ground).&lt;br /&gt;&lt;br /&gt;You can see all the LEDs bridging from the + rail to the pins on the M5451 (middle)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I wrote a bit of code to drive the M5451 (see below).  You can turn on each M5451 switch independently, control the brightness via one of the Arduino's PWM ports (PWM means pulse-width-modulation -- the Arduino toggles the line between 5 and 0 volts rapidly and so that it seems like the line actually has a voltage which is the weighted average of the time the line is 5 vs. 0 -- i.e. a simulated analog voltage).&lt;br /&gt;&lt;br /&gt;On top of that, I made a class that is similar to PWM; it toggles the M5451 lines rapidly so the LEDs seem to change brightness.&lt;br /&gt;&lt;br /&gt;Here is a video.  To make it come out, I have a halogen desk lamp shining directly on the board from about a foot away.  About halfway through I turned off the light so you could see the LED brightness in normal room light!  Check out the video here:&lt;br /&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-6c9a841265feaeda" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v16.nonxt5.googlevideo.com/videoplayback?id%3D6c9a841265feaeda%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330289451%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D5BA7D3F11913C3B9E50C5B93220D4018B45F6A2A.7B87BF7DCCEFFE2E6DE565A3731EE5C2101EAD20%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D6c9a841265feaeda%26offsetms%3D5000%26itag%3Dw160%26sigh%3DsQM3u3IL_nFX4YfVwz9QatF1Rkg&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v16.nonxt5.googlevideo.com/videoplayback?id%3D6c9a841265feaeda%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330289451%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D5BA7D3F11913C3B9E50C5B93220D4018B45F6A2A.7B87BF7DCCEFFE2E6DE565A3731EE5C2101EAD20%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D6c9a841265feaeda%26offsetms%3D5000%26itag%3Dw160%26sigh%3DsQM3u3IL_nFX4YfVwz9QatF1Rkg&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's the code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt; * M5451 LED driver chip&lt;br /&gt; * Author: G. Andrew Stone&lt;br /&gt; * Public Domain&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;int myClockPin = 2;             // Arduino pin that goes to M5451 clock&lt;br /&gt;int mySerDataPin = 3;           // Arduino pin that goes to M5451 data&lt;br /&gt;&lt;br /&gt;void setup()                    // run once, when the sketch starts&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#define M5451_NUMOUTS 35&lt;br /&gt;#define M5451_CLK 0&lt;br /&gt;class M5451&lt;br /&gt;{&lt;br /&gt;  public:&lt;br /&gt;  byte clockPin;&lt;br /&gt;  byte brightPin;&lt;br /&gt;  byte serDataPin;&lt;br /&gt;  M5451(byte clockPin,byte serDataPin,byte brightPin);&lt;br /&gt;     &lt;br /&gt;  void set(unsigned long int a, byte b=0);&lt;br /&gt;  void setBrightness(byte b);&lt;br /&gt; &lt;br /&gt;  private:&lt;br /&gt;  void mydelay(int clk);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void M5451::setBrightness(byte b)&lt;br /&gt;{&lt;br /&gt;  if (brightPin &lt; 0xff)&lt;br /&gt;    analogWrite(brightPin,b);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#define MaxBrightness 4096  //256&lt;br /&gt;class FlickerBrightness:public M5451&lt;br /&gt;{&lt;br /&gt;  public:&lt;br /&gt;  FlickerBrightness(byte clkPin, byte dataPin, byte brightnessPin);&lt;br /&gt; &lt;br /&gt;  void shift(int amt=1)&lt;br /&gt;    {&lt;br /&gt;    offset+=amt;&lt;br /&gt;    if (offset&gt;=M5451_NUMOUTS) offset -=M5451_NUMOUTS;&lt;br /&gt;    else if (offset&lt; 0) offset +=M5451_NUMOUTS;&lt;br /&gt;    }&lt;br /&gt;  void loop(void);&lt;br /&gt; &lt;br /&gt;  int brightness[M5451_NUMOUTS];&lt;br /&gt;  int bresenham[M5451_NUMOUTS];&lt;br /&gt;  int iteration;&lt;br /&gt;  int offset;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;FlickerBrightness::FlickerBrightness(byte clkPin, byte dataPin,byte brightnessPin):M5451(clkPin,dataPin,brightnessPin)&lt;br /&gt;{&lt;br /&gt;  for (int i=0;i &lt; M5451_NUMOUTS;i++)&lt;br /&gt;  {&lt;br /&gt;    brightness[i] = 0;&lt;br /&gt;    bresenham[i]  = 0;&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  iteration = 0;&lt;br /&gt;  offset = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void FlickerBrightness::loop(void)&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt;  byte pos;&lt;br /&gt;  unsigned long int a=0;&lt;br /&gt;  byte b=0;&lt;br /&gt;  boolean lvl=false;&lt;br /&gt; &lt;br /&gt;  for (i=0,pos=offset;i &lt; M5451_NUMOUTS;i++,pos++)&lt;br /&gt;    {&lt;br /&gt;      if (pos&gt;=M5451_NUMOUTS) pos=0;&lt;br /&gt;      bresenham[i] += brightness[pos];&lt;br /&gt;      if (bresenham[i]&gt;=MaxBrightness)&lt;br /&gt;        {&lt;br /&gt;          bresenham[i] -= MaxBrightness;&lt;br /&gt;          lvl = true;&lt;br /&gt;        }&lt;br /&gt;      else lvl = false;&lt;br /&gt;     &lt;br /&gt;      if (i&lt;32) a = (a&lt;&lt;1)|lvl;&lt;br /&gt;      else b = (b&lt;&lt;1)|lvl;&lt;br /&gt;    }&lt;br /&gt;  iteration++;&lt;br /&gt;  if (iteration &gt; MaxBrightness) iteration = 0; &lt;br /&gt; &lt;br /&gt;  set(a,b);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;M5451::M5451(byte clkPin, byte dataPin, byte brightnessPin)&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt; &lt;br /&gt;  clockPin = clkPin;&lt;br /&gt;  serDataPin = dataPin;&lt;br /&gt;  brightPin = brightnessPin;&lt;br /&gt; &lt;br /&gt;  pinMode(clkPin, OUTPUT);      // sets the digital pin as output&lt;br /&gt;  pinMode(serDataPin, OUTPUT);      // sets the digital pin as output&lt;br /&gt;  pinMode(brightPin,OUTPUT);&lt;br /&gt;&lt;br /&gt;  // Clear out the device so we can clock in items&lt;br /&gt;  digitalWrite(serDataPin,LOW); &lt;br /&gt;  for (i=0;i&lt; M5451_NUMOUTS+2;i++)&lt;br /&gt;    {&lt;br /&gt;    mydelay(M5451_CLK);&lt;br /&gt;    digitalWrite(clockPin,HIGH);&lt;br /&gt;    mydelay(M5451_CLK);&lt;br /&gt;    digitalWrite(clockPin,LOW);   &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void M5451::mydelay(int clk)&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt;  for (i=0;i&lt; clk;i++);&lt;br /&gt;  //delay(clk);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void M5451::set(unsigned long int a, byte b)&lt;br /&gt;{&lt;br /&gt;  int i;&lt;br /&gt;&lt;br /&gt;  // Write the initial "start" signal&lt;br /&gt;  digitalWrite(clockPin,LOW);&lt;br /&gt;  digitalWrite(serDataPin,LOW);&lt;br /&gt;  mydelay(M5451_CLK);&lt;br /&gt;  digitalWrite(clockPin,HIGH);&lt;br /&gt;  mydelay(M5451_CLK);&lt;br /&gt;  digitalWrite(clockPin,LOW);&lt;br /&gt;  mydelay(M5451_CLK/2);&lt;br /&gt;  digitalWrite(serDataPin,HIGH);&lt;br /&gt;  mydelay(M5451_CLK/2);&lt;br /&gt;  digitalWrite(clockPin,HIGH);&lt;br /&gt;  mydelay(M5451_CLK);&lt;br /&gt;  digitalWrite(clockPin,LOW);&lt;br /&gt;   &lt;br /&gt;  // Write the bits&lt;br /&gt;  for (i=0;i&lt; M5451_NUMOUTS;i++)&lt;br /&gt;  {&lt;br /&gt;    int serDataVal;&lt;br /&gt;    if (i&lt;32) serdataval =" (a&amp;amp;1);"&gt;&gt;=1;}&lt;br /&gt;    else { serDataVal = (b&amp;amp;1); b&gt;&gt;=1;}&lt;br /&gt;    mydelay(M5451_CLK/2);&lt;br /&gt;    digitalWrite(serDataPin,serDataVal);&lt;br /&gt;    mydelay(M5451_CLK/2);&lt;br /&gt;    digitalWrite(clockPin,HIGH);&lt;br /&gt;    mydelay(M5451_CLK);&lt;br /&gt;    digitalWrite(clockPin,LOW);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop()                     // run over and over again&lt;br /&gt;{&lt;br /&gt;  unsigned long int j;&lt;br /&gt;  int i;&lt;br /&gt;  FlickerBrightness leds(myClockPin,mySerDataPin,9);&lt;br /&gt; &lt;br /&gt;  leds.setBrightness(255);&lt;br /&gt;&lt;br /&gt;  for (i=3;i&gt;=0;i--)&lt;br /&gt;  {&lt;br /&gt;    for (j=0;j&lt;35;j++)&lt;br /&gt;      {&lt;br /&gt;      leds.set(1L&lt;&lt; j,(j&gt;=32) ? 1L&lt;&lt;(j-32):0);&lt;br /&gt;      delay(10*i);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Proportional fading&lt;br /&gt;  if (1) for (j=0;j&lt;200;j++)&lt;br /&gt;    {&lt;br /&gt;      for (i=0;i&lt; M5451_NUMOUTS;i++)&lt;br /&gt;        {&lt;br /&gt;          int k = 1&lt;&lt;(j%13);&lt;br /&gt;          if ((i&amp;amp;3)&lt;2)&lt;br /&gt;          {&lt;br /&gt;             if (leds.brightness[i] &lt; 35) leds.brightness[i] = 35;&lt;br /&gt;             else leds.brightness[i] += leds.brightness[i]&gt;&gt;2;           &lt;br /&gt;          }&lt;br /&gt;          else&lt;br /&gt;          {&lt;br /&gt;             if (leds.brightness[i] &lt; 35) leds.brightness[i] = MaxBrightness;&lt;br /&gt;             else leds.brightness[i] -= leds.brightness[i]&gt;&gt;2;           &lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      for (i=0;i&lt;100;i++) leds.loop();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  leds.set(0xffffffff,0xff);  /* ALL ON */&lt;br /&gt;  delay(250);&lt;br /&gt;  leds.set(0,0);  /* ALL OFF */&lt;br /&gt;  delay(250);&lt;br /&gt;&lt;br /&gt;  // Linear per-LED brightness method&lt;br /&gt;  if (1) for (j=0;j&lt;4096;j++)&lt;br /&gt;    {&lt;br /&gt;      for (i=0;i&lt; M5451_NUMOUTS;i++)&lt;br /&gt;        {&lt;br /&gt;          int k = j*10;&lt;br /&gt;          if (i&amp;amp;1)&lt;br /&gt;          {       &lt;br /&gt;            leds.brightness[i] = abs((k&amp;amp;(MaxBrightness*2-1))-MaxBrightness);&lt;br /&gt;          }&lt;br /&gt;          else&lt;br /&gt;            leds.brightness[i] = MaxBrightness - abs((k&amp;amp;(MaxBrightness*2-1))-MaxBrightness);&lt;br /&gt;        }&lt;br /&gt;      for (i=0;i&lt;10;i++) leds.loop();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  // ALL FADE using M5451 Brightness feature&lt;br /&gt;  leds.set(0xffffffff,0xff);  /* ALL ON */&lt;br /&gt;  for (j=1;j&lt;5;j++)&lt;br /&gt;   {&lt;br /&gt;   for (i=0;i&lt;256;i++)&lt;br /&gt;      {&lt;br /&gt;      leds.setBrightness(i&amp;amp;255);&lt;br /&gt;      delay(j);&lt;br /&gt;      }&lt;br /&gt;   for (i=255;i&gt;=0;i--)&lt;br /&gt;      {&lt;br /&gt;      leds.setBrightness(i&amp;amp;255);&lt;br /&gt;      delay(j);&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;  leds.setBrightness(255);&lt;br /&gt;&lt;br /&gt;  leds.set(0xffffffff,0xff);  /* ALL ON */&lt;br /&gt;  delay(250);&lt;br /&gt;  leds.set(0,0);  /* ALL OFF */&lt;br /&gt;  delay(250);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  // MARQUEE&lt;br /&gt; &lt;br /&gt;  for (i=0;i&lt; M5451_NUMOUTS;i++)  // Clear all LEDs to black&lt;br /&gt;    {&lt;br /&gt;      leds.brightness[i]=0;&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;  // Turn on a couple to make a "comet" with dimming tail &lt;br /&gt;  leds.brightness[0] =  MaxBrightness-1;&lt;br /&gt;  leds.brightness[1] =  MaxBrightness/2;&lt;br /&gt;  leds.brightness[2] =  MaxBrightness/4;&lt;br /&gt;  leds.brightness[3] =  MaxBrightness/8;&lt;br /&gt;  leds.brightness[4] =  MaxBrightness/16;&lt;br /&gt;  leds.brightness[5] =  MaxBrightness/64;&lt;br /&gt;  leds.brightness[6] =  MaxBrightness/100;&lt;br /&gt;&lt;br /&gt;  for (j=0;j&lt;100;j++)&lt;br /&gt;    {&lt;br /&gt;      leds.shift(1);&lt;br /&gt;      for (i=0;i&lt;150;i++) leds.loop();&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;  for (j=0;j&lt;100;j++)&lt;br /&gt;    {&lt;br /&gt;      leds.shift(-1);&lt;br /&gt;      for (i=0;i&lt;100;i++) leds.loop();&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;  if (1)&lt;br /&gt;{ &lt;br /&gt;  leds.set(0xffffffff,0x7);&lt;br /&gt;  delay(1000);&lt;br /&gt;  //leds.set(0xf0f0f0f0,0x7);&lt;br /&gt;  //delay(10000);&lt;br /&gt;  //leds.set(0x11111111,0x1);&lt;br /&gt;  //delay(10000);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/824114889882641219-2540402850732148610?l=effluviaofascatteredmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=6c9a841265feaeda&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://effluviaofascatteredmind.blogspot.com/feeds/2540402850732148610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/arduino-and-m5451-control-35-leds.html#comment-form' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2540402850732148610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/824114889882641219/posts/default/2540402850732148610'/><link rel='alternate' type='text/html' href='http://effluviaofascatteredmind.blogspot.com/2009/02/arduino-and-m5451-control-35-leds.html' title='Arduino and M5451 -- Control 35 LEDs, motors, etc!'/><author><name>G. Andrew Stone</name><uri>https://profiles.google.com/104874826842255002926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-9if4CsHfrHc/AAAAAAAAAAI/AAAAAAAAAZc/qALRFFiJhJ4/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XQ0vbXkszcw/SaHDNZFhNwI/AAAAAAAAAKk/TOAJVXotPV0/s72-c/PICT0005.JPG' height='72' width='72'/><thr:total>23</thr:total></entry></feed>
