<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Memos From the Cube</title> <atom:link href="http://fourwalledcubicle.com/blog/feed/" rel="self" type="application/rss+xml" /><link>http://fourwalledcubicle.com/blog</link> <description>Blog for Dean Camera</description> <lastBuildDate>Wed, 01 Sep 2010 13:25:47 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Competition Winners, PCBs and PS3s</title><link>http://fourwalledcubicle.com/blog/2010/09/competition-winners-pcbs-ps3s/</link> <comments>http://fourwalledcubicle.com/blog/2010/09/competition-winners-pcbs-ps3s/#comments</comments> <pubDate>Wed, 01 Sep 2010 13:03:00 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[LUFA (Formerly MyUSB) Library]]></category> <category><![CDATA[Misc.]]></category> <category><![CDATA[Projects]]></category> <category><![CDATA[University]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=719</guid> <description><![CDATA[Sometimes I worry that I&#8217;m not accomplishing enough each week to have something to say here, while others I&#8217;ve got so much to write about I have to cherry pick to avoid putting those who stumble here into an irreversible coma. This week I think I&#8217;ve hit the right balance. First and foremost &#8211; it&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>Sometimes I worry that I&#8217;m not accomplishing enough each week to have something to say here, while others I&#8217;ve got so much to write about I have to cherry pick to avoid putting those who stumble here into an irreversible coma. This week I think I&#8217;ve hit the right balance.</p><p>First and foremost &#8211; it&#8217;s time to announce the winners of the <a
title="Win a USBTINU-MKII!" href="http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/">USBTINY-MKII competition</a>! I was a bit annoyed that the finish date crept up on me so quickly, as I had plans to create a LUFA noise generator device using the CDC class driver and a zener noise source to pick the winners. Not to worry, I ended up just using three values from <a
title="Random.org - True Random Numbers" href="http://www.random.org">Random.org</a> to choose the lucky three. Without further ado, let&#8217;s all congratulate the winners:</p><ol><li><strong>Marco (No Last Name Given)</strong></li><li><strong>Jim Bowen</strong></li><li><strong>Martin Degelsegger</strong></li></ol><p>I&#8217;ll notify the winners via email also to get their shipping addresses. I&#8217;ve been really, really happy with the way the competition&#8217;s gone; some great (big and small) bugs were reported, leading to a less buggy code and (hopefully) more satisfied user-base in the future. Totally win-win and something I hope to repeat in the future, with (possibly) a small reward for every reported bug so that no one misses out. My apologies to those contributors who didn&#8217;t win this time around; as much as I&#8217;ve love to give away something to everyone who contributed, I simply can&#8217;t afford to.</p><p>Each of those three winners has won a brand new <a
title="Tom's USBTINY-MKII programmer page" href="http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php">USBTINY-MKII V1 programmer</a> from Tom &#8211; but paid for by yours truly, of course. Last week I reported on Tom&#8217;s adapter boards and reset recovery board, however I&#8217;ve now been told this is false information; while the reset recovery board is now available, the remaining adapter boards are only being <em>considered</em> for production. Actually, Tom&#8217;s now told me that he&#8217;s considering selling the adapter boards with the programmer as a small &#8220;kit&#8221; for a few dollars more than the base price, as the adapters alone would be swamped by shipping costs.</p><p>One last thing I&#8217;ll post here for now on the programmers is a shot of Tom&#8217;s &#8220;V2&#8243; prototype, which come in a fancy blue translucent case with silk-screening, and will become available in a limited supply soon. I really hope Tom posts some articles on the production process, as he&#8217;s done the case milling and silk-screening himself.</p><div
class="wp-caption aligncenter" style="width: 410px"><a
title="Tom's USBTINY-MKII Programmer Kit" rel="lightbox" href="http://www.fourwalledcubicle.com/img/Blog/USBTinyMkII_Kit.jpg"><img
class=" " title="USBTINY-MKII V2 Kit" src="http://www.fourwalledcubicle.com/img/Blog/USBTinyMkII_Kit_thumb.jpg" alt="Tom's USBTINY-MKII Programmer Kit" width="400" height="301" /></a><p
class="wp-caption-text">Tom&#39;s USBTINY-MKII Programmer Kit</p></div><p
style="text-align: center;"><p
style="text-align: center;"><p
style="text-align: left;">Now on to my own electronics efforts. Last week I mentioned that I was laying out a PCB as part of my third year electronics project (I&#8217;m actually in my fourth University year, however as I&#8217;m doing a double degree, I&#8217;m doing third year subjects of both Electronics and Computer Science at the moment). Since that post I&#8217;ve come a long way and I&#8217;m actually very nearly finished:</p><div
class="wp-caption aligncenter" style="width: 310px"><a
title="My first PCB design" rel="lightbox" href="http://www.fourwalledcubicle.com/img/Blog/ThirdYearPCB.png"><img
class=" " title="Third Year Project PCB" src="http://www.fourwalledcubicle.com/img/Blog/ThirdYearPCB_thumb.png" alt="My first PCB design" width="300" height="254" /></a><p
class="wp-caption-text">My first PCB design</p></div><p
style="text-align: center;"><p
style="text-align: left;">Which I&#8217;m fairly happy with, given that it&#8217;s my first ever PCB layout, and first time using Altium Designer. There&#8217;s still some tweaking to be done before the final submission for production on Monday, but all things considered I think I&#8217;ve learned a huge amount in only a few short weeks. Special thanks to my friend Andrei for his great feedback on my (cruddy) design, as his advice has helped me a great deal in improving my layout.</p><p
style="text-align: left;">After production comes board population, which will be a huge undertaking it of itself; I&#8217;ll need to work out a strategy for which components to populate first in order to make later components easier to mount. Actually, given that I&#8217;ve only soldered a few surface mount components before, I&#8217;m a little worried about trashing the board since we only get the one.</p><p
style="text-align: left;">Finally will come the coding, and that&#8217;s where I hope to shine, since it&#8217;s my strong suit. What got me was that <em>no one is expected to actually finish the project</em>. Exactly bunk number of people finished it completely over the past few years &#8211; the point of it is to get us comfortable progressing from schematic to finished board, with the operation being, well, optional. I&#8217;m told one can pass if the board powers on without catching fire and the LCD can be controlled &#8211; but of course I aim to be the first in several years to make it work before the final deadline.</p><p
style="text-align: left;"><p
style="text-align: left;">As of this week, I&#8217;ve now got a job at the University teaching C code (regular and embedded) to a bunch of 5th year international master&#8217;s students once a week for the next month or so. It&#8217;s certainly an experience for me and a good chance to develop my teaching skills, so I&#8217;ve taken it on quite happily. In a few weeks I&#8217;ll be running my first lab class solo, meaning that I&#8217;ve been given a copy of the laboratory task sheet, a stack of marking sheets, a pat on the back and a &#8220;<em>you&#8217;ll do fine</em>&#8220;.</p><p
style="text-align: left;"><p
style="text-align: left;"><p
style="text-align: left;">But finally today is a bit of news I stumbled across this afternoon while idling. A few weeks ago there was a lot of buzz about an Australian crew who managed to jailbreak the Playstation 3 console, using only a small USB dongle that plugs into the front USB ports. It&#8217;s great to hear news of a solution to PS3 homebrew problem now that Sony&#8217;s killed the &#8220;OtherOS&#8221; functionality of the consoles, however the inevitable legal injunction taken out by Sony means the (rather expensive, I thought) dongles are currently off the market. Not to worry, as an enterprising hacker has come up with an open source &#8211; and LUFA powered &#8211; clone of the dongle&#8217;s functionality, called <em>PSGroove</em>. Just <a
title="PSGroove PS3 Jailbreak Project" href="http://github.com/psgroove/psgroove">download the source code</a>, compile it for the USB AVR of your choice, and plug it into your console.</p><p
style="text-align: left;">That&#8217;s bloody great news, as it will obviously be a high-visibility project right up until Sony&#8217;s pack of <span
style="text-decoration: line-through;">fun destroying jerks</span> engineers figure out a patch to prevent the jailbreak. Until then, LUFA should become quite a bit more popular &#8211; and used around the world &#8211; and hopefully other interesting hacks will come about from it.</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/09/competition-winners-pcbs-ps3s/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Reports of my demise&#8230;</title><link>http://fourwalledcubicle.com/blog/2010/08/reports-of-my-demise/</link> <comments>http://fourwalledcubicle.com/blog/2010/08/reports-of-my-demise/#comments</comments> <pubDate>Sat, 21 Aug 2010 12:30:28 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[LUFA (Formerly MyUSB) Library]]></category> <category><![CDATA[Projects]]></category> <category><![CDATA[University]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=707</guid> <description><![CDATA[It&#8217;s been two weeks since I last posted here, but it feels like months. I&#8217;ve been absolutely flat out working to try to get all my University assignments and projects up to scratch, putting in 9-6 days every day during the week even though I&#8217;ve only got classes scheduled for a fraction of that. I&#8217;ll [...]]]></description> <content:encoded><![CDATA[<p>It&#8217;s been two weeks since I last posted here, but it feels like months. I&#8217;ve been <strong>absolutely flat out</strong> working to try to get all my University assignments and projects up to scratch, putting in 9-6 days every day during the week even though I&#8217;ve only got classes scheduled for a fraction of that. I&#8217;ll try to make up for it now in my stolen downtime for the day via a long post.</p><p>Primarily, my time has been taken up by two assignments:</p><h3><strong>Assignment 1: Programming FPGAs</strong></h3><p>Yes, I&#8217;m back into the land of VHDL again, this time moving up from tiny CPLD devices in my introduction to digital design subject to a somewhat larger Cyclone II FPGA. While I haven&#8217;t even thought about VHDL in over a year now (last year was entirely Computer Science subjects, courtesy of my double degree and scheduling) I&#8217;ve been pleasantly surprised how quickly I&#8217;ve remembered everything. Since I have a sequential programming background I initially found parallel design quite mind-bending, but I&#8217;ve now somewhat mastered the (warped) way of thinking required. That makes me a happy chappy, since I&#8217;m no longer fighting myself to finish my first assignment: an asynchronous ALU coded entirely in VHDL.</p><p>I&#8217;m all done with it now, with even most of the report all written up, including simulation. I&#8217;ve found it quite funny that I&#8217;ve become the go-to guy for VHDL code almost immediately, despite me being in the same boat as half the other students. Unfortunately I&#8217;m way too time poor at the moment, or I would snap up one of the awesome <a
title="Altera DE2 Education Board" href="http://www.altera.com/education/univ/materials/boards/unv-de2-board.html">Altera DE2 boards</a> we&#8217;re developing with and see what else I can code up at home.</p><p>Actually, all that&#8217;s got me thinking &#8211; why not create a processor with a regular core, plus a small amount of programmable logic? Companies could produce the one chip with zero on-die peripherals, and instead produce tools so that the engineer could drag-drop the desired peripherals (SPI, I2C, timers, etc) to create the custom chip they need. Done cheaply enough, it could really take off &#8211; not only does the company save money by only needing to create the one low cost design, the engineer could do such advanced things as adding custom coded peripherals to speed up execution in addition to the hand-holding default drag-drop interface. Think of how many times you&#8217;ve thought something like &#8220;I really love the Atmel AVR model X, but I wish it had Y timers with PWM instead of the Z USARTs I&#8217;m not using&#8230;&#8221; and tell me you wouldn&#8217;t jump all over that.</p><h3><strong>Assignment 2: Power/Voltage/Current Meter</strong></h3><p>In order to prepare us for our large-scale project next year, we&#8217;ve been tasked with a somewhat simpler project to complete this semester, to familiarize ourselves with the tasks of creating a schematic, choosing footprints, laying out and drilling boards, soldering surface mount components and programming microcontrollers. Most of those I&#8217;ve somewhat perplexed they haven&#8217;t taught us up to now, but according to the lecturers &#8220;throwing you all in the deep end makes you learn quicker&#8221;. Bah humbug.</p><p>Unfortunately for me, not only is my project (an isolated power meter) set for me, the schematics are also similarly fixed, so I&#8217;m stuck with using a tool I don&#8217;t know, laying out what must be the most over engineered piece of junk known to mankind. To me a power meter is something requiring only a few analogue parts, a LCD and a modern AVR or similar processor. No such luck here &#8211; we <em>must</em> use the truly awful Z8 microprocessor that was developed when bows and arrows were considered &#8220;the next best thing&#8221;, along with four switchmode power supplies producing no less than five voltage rails.</p><p><em><strong>Five. Voltage. Rails.</strong></em></p><p>And we have to lay them out, with no previous experience laying out such much as a morse code beeper, let along anything so complicated. What makes it more fun is that they are teaching us the critical design knowlege (current loops? What are those?) in parallel with our efforts, so we&#8217;re finding the need to rip up large sections and re do them after almost every lecture.</p><p>Having said that, I am indeed learning quickly; I&#8217;ve been showing off my progress periodically on Twitter with my Altium efforts (<a
title="First board layout attempt" href="http://twitpic.com/2fiov8">initial design</a>, <a
title="Second board layout attempt" href="http://twitpic.com/2gd2ax">second design</a> &#8211; I&#8217;ll post an updated and near complete screenshot of my latest layout on Monday) during the week and receiving some very helpful comments. Before now I never really understood why PCB artwork was called artwork, but now I do; layout truly is an art, and those who are naturally good at it should just get a job as a hardware designer. Just as I regularly cringe at the code produced by hardware orientated people, they too cringe when they see my horrible hardware attempts, but I&#8217;ve learned that there should indeed be different people allocated for the two different tasks.</p><h3>And LUFA stuff too&#8230;</h3><p>In LUFA news, I just about cried when I received <a
title="LUFA Bug Report #21: CDC Input overflow/corruption" href="http://code.google.com/p/lufa-lib/issues/detail?id=21">this bug report</a>, along with a solution from Martin Degelsegger &#8211; it pointed out a critical flaw in the way LUFA allocates endpoints and pipes in the class driver which didn&#8217;t seem to have any easy solution. I admit it is my fault for not seeing the one-line warning in the USB AVR datasheets, but I still feel like kicking the Atmel engineer who designed the damned thing; if endpoints or pipes are allocated with a non-ascending index, the bank memory locations in the internal controller DPRAM can be silently overlapped at random offsets even though the controller reports a successful allocation. That&#8217;s damned nasty and something I had no idea about until now, as I was only aware of the &#8220;bank memory fragmentation will break everything&#8221; caveat warned quite prominently in the datasheet.</p><p>I&#8217;ve not yet totally QA&#8217;d my fix, but I&#8217;ve adjusted the Endpoint_ConfigureEndpoint() and Pipe_ConfigurePipe() routines to work around the solution. Basically, the routines cache the configuration of all the endpoints and pipes, then clears them before reallocating them in order with the new endpoint or pipe inserted in the correct place. That seems to fix the problem with out any obvious side effects, other than the deletion of anything currently in the endpoint or pipe banks. Given that endpoint and pipe configuration is done during the enumeration process before any non-control endpoint or pipe is used, this doesn&#8217;t seem to be a problem.</p><p>Finally today is an update on <a
title="Win a USBTINY-MKII!" href="http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/">my competition for a free USBTINY-MKII programmer</a> &#8211; with the above people added to the list, we&#8217;ve got two new contenders:</p><p
style="padding-left: 30px;"><strong>A. Paulin</strong> (One entry)<br
/> <strong>B. Paddock</strong> (Three entries)<br
/> <strong>A. Rohde</strong> (One entry)<br
/> <strong>N. Braun</strong> (One entry)<br
/> <strong>Simon <em>[No Given Last Name, Google Code issue report]</em></strong> (One entry)<br
/> <strong>J. Bowen</strong> (One entry)<br
/> <strong>M. Degelsegger</strong> (Two entries)</p><p>Which makes things really interesting. I&#8217;ll clarify the competition here; only one programmer per winner, so while multiple entries will increase your chance of winning a programmer, it won&#8217;t increase your chances of winning more than one programmer. If you think you&#8217;ve found a bug, <a
title="LUFA Bug Tracker" href="http://code.google.com/p/lufa-lib/issues/list">report it</a> before the 30th to get your chance of winning too!</p><p>Even if you&#8217;re not going to enter into the running for a free programmer, Tom&#8217;s just released news on some really <a
title="Programmer Adapter Boards" href="http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php">neat little adapters</a> for his programmer (although they are generic and will in fact work with any AVR programmer) to make it easy to insert into breadboards (including one with 3.3V voltage regulation) and program AVRs with the RSTDSBL fuse set. Check them out, and if you&#8217;re interested bug him until he releases them up for sale &#8211; scroll down the linked page for the pictures and information. <em>(Tom&#8217;s decided not to sell these for now. Perhaps he&#8217;ll sell them as cheap kits in the future).</em></p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/08/reports-of-my-demise/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>LUFA 100807 Released, and more</title><link>http://fourwalledcubicle.com/blog/2010/08/lufa-100807-released-and-more/</link> <comments>http://fourwalledcubicle.com/blog/2010/08/lufa-100807-released-and-more/#comments</comments> <pubDate>Mon, 09 Aug 2010 03:41:44 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[LUFA (Formerly MyUSB) Library]]></category> <category><![CDATA[Projects]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=695</guid> <description><![CDATA[Today&#8217;s post comes in three parts. PART 1: USBTINY-MKII Competition Update My little competition to win a nice free programmer is finally that, a competition, now there are five names competing for three programmers. There&#8217;s still plenty of time to get your bug reports in on the new release (more on that later) before the [...]]]></description> <content:encoded><![CDATA[<p>Today&#8217;s post comes in three parts.</p><hr
/><h2>PART 1: <em>USBTINY-MKII Competition Update</em></h2><p>My little competition to <a
title="Win a USBTINY-MKII!" href="http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/">win a nice free programmer</a> is finally that, a competition, now there are five names competing for three programmers. There&#8217;s still plenty of time to get your bug reports in on the new release (more on that later) before the end of August so you too can have quite a decent chance of winning some free stuff.</p><p>So far the possible entrants are as follows &#8211; if your name does not appear here and you believe you should be included a you have submitted a bug report since the competition was announced, send me an email.</p><p
style="padding-left: 30px;"><strong>A. Paulin</strong> (One entry)<br
/> <strong>B. Paddock</strong> (Three entries)<br
/> <strong>A. Rohde</strong> (One entry)<br
/> <strong>N. Braun</strong> (One entry)<br
/> <strong>Simon <em>[No Given Last Name, Google Code issue report]</em></strong> (One entry)</p><p>Thank you to the above people. If you want to be on this list, get testing!</p><hr
/><h2>PART 2: <em>LUFA Licensing Update</em></h2><p><em>Woah boy.</em> I&#8217;ve been more than surprised by the volume of feedback I&#8217;ve received over the last week once I opened up the public discussion about the changing of LUFA&#8217;s licensing. I wasn&#8217;t expecting to receive loads of happy messages, but now I know how the folk over at Twitter feel; all the responses I&#8217;ve got via public and private emails so far have all indicated that LUFA is, by and large, entirely worthless in its current form. Not worthless in that it&#8217;s not useful for commercial purposes, but that it&#8217;s worthless in that no one&#8217;s willing to pay me to use it.</p><p>I was planning on collecting everyone&#8217;s thoughts, and posting them here argument-by-argument with my own feedback, so that the optimum licensing conditions could be fleshed out so as to minimize the impact to everybody while still giving me some income for my work. However, it is no clear from all the <em>&#8220;change it and we will fork the codebase/switch libraries before paying&#8221; </em>comments that this won&#8217;t work. To that end, I&#8217;m ending the discussions early, keeping the licensing as-is for now, and adjusting my support/development/release efforts to suit.</p><p>Once I begin porting LUFA I will ensure that all ported code will be heavily restricted for any use other than private testing before committing it to the public repository, and try again. As has been made clear, if a free older version exists, people simply won&#8217;t license newer code. With ports will come new users, and hopefully new income opportunities for myself.</p><p>I apologize to everyone who has sent me emails on this which I have not answered due to their volume and my time constraints &#8211; however seeing as this issue is currently dead I hope all those kind enough to contact me will forgive me.</p><hr
/><h2>PART 3: <em>New LUFA 100807 Release!<br
/> </em></h2><p>I&#8217;m a little late on my schedule on this, but today I&#8217;ve released LUFA 100807 &#8211; I simply forgot what day the seventh was when I scheduled in 100807, as I&#8217;m usually away from my PC on weekends. Nevertheless, going by the age-old saying of &#8220;better late than never&#8221;, today I&#8217;ve packaged up the repository trunk and pushed it out as a public release. So as not to confuse everyone too much I&#8217;ve kept the 100807 name, even though it&#8217;s technically one or two days late.</p><p>As I&#8217;ve said above, this release maintains the existing MIT+Attribution license that has been a component of LUFA for over a year now, so no need to worry.</p><p>Special thanks to Bob Paddock for his excellent feedback during the beta cycles, as he did an amazing job of testing various components of the library and finding issues. Also thanks to all the other testers and donators, who&#8217;ve helped out.</p><p>As usual, the downloads are all available on the <a
title="LUFA Project Page" href="http://www.fourwalledcubicle.com/LUFA.php">LUFA project page</a>, although I&#8217;ll also link to the direct downloads here too for convenience.</p><p><a
title="LUFA 100807 Release Download" href="http://code.google.com/p/lufa-lib/downloads/detail?name=LUFA-100807.zip&amp;can=2&amp;q=">LUFA 100807 Release Download</a></p><p><a
title="LUFA 100807 Prebuilt Documentation Download" href="http://fourwalledcubicle.com/files/LUFA/Doc/LUFA-100807-Documentation.zip">LUFA 100807 Prebuilt Documentation Download</a></p><p><a
title="LUFA 100807 Online Documentation" href="http://fourwalledcubicle.com/files/LUFA/Doc/100807/html/">Online LUFA 100807 Documentation</a></p><h3>Changelog for Version 100807</h3><p><strong>New:</strong></p><ul><li>Added new ADC_DisableChannel() function (thanks to Mich Davis)</li><li>Added new VTARGET_REF_VOLTS and VTARGET_SCALE_FACTOR compile time  defines to the AVRISP-MKII programmer project to set the VTARGET  reference voltage and scale factor</li><li>Added new pgm_read_ptr() macro to Common.h for reading of pointers out of flash memory space</li><li>Added new SWAPENDIAN_16() and SWAPENDIAN_32() macros to Common.h for statically initialized variables at compile time</li><li>Added new Drivers/USB/LowLevel/Device.c file to house Device mode  specific functions that are more complicated than simple macros</li><li>Added new AVRStudio 4 project files for all library demos, projects and bootloaders</li><li>Added ability to set the serial baud rate via the user&#8217;s terminal in the XPLAINBridge project</li><li>Added new LUFA module variables for the different source modules in the core library makefile to simplify project makefiles</li><li>Added start of a new Test and Measurement class demo (thanks to Peter Lawrence)</li><li>Added new SPI_ORDER_* data order masks to the SPI peripheral driver</li><li>Added support to the AVRISP-MKII project for ISP speeds slower than 125KHz via a new software SPI driver</li><li>Added support for the new button/LED on the latest model USBTINY-MKII</li></ul><p><strong>Changed:</strong></p><ul><li>The RingBuff library code has been replaced in the XPLAINBridge,  Benito and USBtoSerial projects with an ultra lightweight ring buffer to  help improve the reliability of the projects</li><li>The EEPROM stream read/write functions now use eeprom_update_byte()  instead of eeprom_write_byte(), so that only changed bytes are written  to EEPROM to preserve its lifespan</li><li>Changed over the AVRISP-MKII and TemperatureDataLogger projects to  use eeprom_update_byte() when writing non-volatile parameters to EEPROM  to preserve its lifespan</li><li>Removed unused line encoding data and control requests from the CDC Bootloader code, to save space</li><li>Renamed SERIAL_STREAM_ASSERT() macro to STDOUT_ASSERT()</li><li>The USB_Device_IsRemoteWakeupSent() and USB_Device_IsUSBSuspended() macros have been deleted, as they are now obsolete</li><li>Rewrote the implementation of the SwapEndian_16() and SwapEndian_32() functions so that they compile down in most instances to minimal loads and stores rather than complicated shifts</li><li>The software UART in the XPLAINBridge has been largely altered to try to improve upon its performance and reliability</li><li>The USBtoSerial and Benito projects now flushes received data via a  flush timer, so that several bytes can be transmitted at once</li><li>Removed the automated checking of event names in the demo, project  and bootloader makefiles due to inconsistencies between the behaviour of  the command line tools used to perform the check on each platform</li><li>Internal USB driver source files renamed and moved to ease future possible architecture ports</li><li>All internal pseudo-function macros have been converted to true inline functions for type-safety and readability</li><li>Changed LED indicator masks for the AVRISP-MKII project, so that there are defined roles for each LED</li><li>Altered the CDC Device and Host Class drivers&#8217; receive byte  routines, so that no data is indicated by the function returning a  negative value (thanks to Andreas Paulin)</li><li>Added auto flushing of OUT data to the CDC Host Class driver&#8217;s USBTask function to automatically flush the send pipe buffer</li></ul><p><strong>Fixed:</strong></p><ul><li>Fixed AVRISP project sending a LOAD EXTENDED ADDRESS command to  128KB AVRs after programming or reading from the last page of FLASH  (thanks to Gerard Sexton)</li><li>Fixed AVRISP project not sending a full erase-and-write EEPROM  command to XMEGA targets when writing to the EEPROM instead of the split  write-only command (thanks to Tim Margush)</li><li>Fixed RNDISEthernet demos crashing when calculating checksums for  Ethernet/TCP packets of more than ~500 bytes due to an overflow in the  checksum calculation loop (thanks to Kevin Malec)</li><li>Fixed XPLAINBridge project not correctly reading the XMEGA&#8217;s supply voltage when reporting back to the host</li><li>Fixed incorrect signature for the ATMEGA32U2 in the DFU bootloader (thanks to Axel Rohde)</li><li>Fixed internal device serial not being accessible on the ATMEGAXXU2 AVRs (thanks to Axel Rohde)</li><li>Fixed void pointer arithmetic in ConfigDescriptor.h breaking C++ compatibility (thanks to Michael Hennebry)</li><li>Fixed broken PDI EEPROM Section Erase functionality in the AVRISP-MKII project</li><li>Fixed USB_Device_SendRemoteWakeup() not working when the USB clock was frozen during USB bus suspend (thanks to Brian Dickman)</li><li>Fixed occasional lockup of the AVRISP project due to the timeout  extension code incorrectly extending the timeout in PDI and TPI  programming modes infinitely</li><li>Fixed HID device class driver still using PrevReportINBuffer for  GetReport control requests even when it has been set to NULL by the user  application (thanks to Axel Rohde)</li><li>Fixed MIDI_Device_SendEventPacket() not correctly waiting for the endpoint to become ready (thanks to Robin Green)</li><li>Fixed Benito and USBtoSerial projects not turning off the USART  before reconfiguring it, which could cause incorrect operation to occur  (thanks to Bob Paddock)</li><li>Fixed Serial peripheral driver not turning off the USART before  reconfiguring it, which would cause incorrect operation to occur (thanks  to Bob Paddock)</li><li>Fixed software application start command broken in the DFU class  bootloader when dfu-programmer is used due to application start address  corruption</li></ul> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/08/lufa-100807-released-and-more/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>LUFA Licensing Discussion</title><link>http://fourwalledcubicle.com/blog/2010/08/lufa-licensing-discussion/</link> <comments>http://fourwalledcubicle.com/blog/2010/08/lufa-licensing-discussion/#comments</comments> <pubDate>Wed, 04 Aug 2010 09:28:40 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[LUFA (Formerly MyUSB) Library]]></category> <category><![CDATA[Projects]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=686</guid> <description><![CDATA[One of the great things about LUFA is the community &#8211; giving it away for so long as undoubtedly made it as good as it is today, as all those free guinea pigs users helped motivate me to develop it further. Originally licensed under a LGPL license, I then moved to an even more lax [...]]]></description> <content:encoded><![CDATA[<p>One of the great things about LUFA is the community &#8211; giving it away for so long as undoubtedly made it as good as it is today, as all those <span
style="text-decoration: line-through;">free guinea pigs</span> <strong>users</strong> helped motivate me to develop it further. Originally licensed under a LGPL license, I then moved to an even more lax MIT license (with attribution), which is where the project stands today.</p><p>A few months ago I tested the waters into monetizing my work, by offering companies a chance to opt-out of the attribution clause of the MIT license via a one-time US$1500 payment. While this has been taken up on a handful (singular) of parties, the results of my experiment have not exactly been encouraging for me.</p><p>I&#8217;ve identified a number of issues:</p><ol><li><strong>People seem to have trouble working out what exactly the attribution clause of the license requires them to do</strong> &#8211; I agree, it is a little less explicit than I would like. My intention was for the user to be legally required to put something like <em>&#8220;uses components from the LUFA library, by Dean Camera, &lt;link&gt;&#8221;</em> in their product manual and website, but in practice this has resulted in just a simple link back to my LUFA page with no information.</li><li><strong>Companies like money. I like money too, but companies aren&#8217;t charitable.</strong> Unless I force them to, few will fork out the money for a license with few obvious benefits to them.</li><li><strong>Unless the company is producing many units or is making a high margin, the current fixed license fee isn&#8217;t attractive.</strong> A better per-unit block breakdown is required, even though I detest such things.</li></ol><p>And so at the risk of becoming hated by the masses everywhere, I&#8217;m now getting the feeling that the license of the library core needs to be changed, so that companies are forced into paying a license for my work. I hate rash decisions as much as everyone else, and I really, really don&#8217;t want to risk losing all the kind, generous and fascinating users I&#8217;ve gained so far, so I&#8217;m putting this up for discussion here.</p><p>Here&#8217;s what I&#8217;m thinking of so far.<em> I&#8217;d like everyone who uses LUFA, who has thought about using LUFA, or just has something to say to chip in here, so I can get a feel for the public&#8217;s reaction to this.</em><strong> </strong>Please also mention how you are using LUFA, so I can see how the following changes will impact existing users.</p><p>Here are the proposed changes to the Licensing of LUFA:</p><ul><li><strong>Non-commercial users </strong>will be granted a license to use LUFA freely, with attribution, via a <a
title="Creative Commons BY-NC-SA License Details" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons BY-NC-SA license</a>. Put simply, this means you can use LUFA all you like, as long as you don&#8217;t make money off of it selling devices in any reasonable quantitiy, and give attribution. From a practical standpoint, this is pretty much the current status quo, except it forbids most uses of LUFA commercially outside one-offs or internal evaluation/use. Hopefully this will not alienate the existing user-base, as free projects can continue to exist and be produced using LUFA.</li><li><strong>Commercial users with less than 10 units produced </strong>- this will usually only be due to internal evaluation &#8211; will also be able to use LUFA for free, via a license which permits commercial use on this very small scale, but does not permit redistribution under this license.</li><li><strong>Commercial users with less than 50 units produced</strong> will be required to license LUFA commercially, for a cost of US$400. This is a one-time, perpetual license like the current commercial license, and will include two hours of free consultation with myself to get companies off and running with LUFA.</li><li><strong>Commercial users with less than 150 units produced</strong> will also need a license with the same terms, but the cost will increase to US$800. This should remain profitable, while gaining me a little more income at the same time.</li><li><strong>Commercial users with over 150 units produced</strong> will need a US$1500 license, and will get three free hours of consultation &#8211; the same as the current license.</li></ul><p>Of course, licenses would be upgradable just by paying the difference, so it would be fine to start low and ramp up as your company produces more units. Existing license holders would automatically switch over to the &#8220;best&#8221; commercial license offered, and all commercial licenses would be valid for any future enhancements of LUFA subject to the terms of the purchased license.</p><p>So, that&#8217;s what I&#8217;m currently leaning towards; the existing hobbyist community &#8211; which is very, <em>very</em> important to me &#8211; can continue to enjoy LUFA free of charge, so that only commercial users will need to pay anything to use LUFA. Some special projects I make (like the XPLAINBridge) will be exempt from the licensing structure, and free use will be granted of the LUFA core when used inside those projects.</p><p>Ok people, voice your thoughts and objections!</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/08/lufa-licensing-discussion/feed/</wfw:commentRss> <slash:comments>19</slash:comments> </item> <item><title>LUFA 100807 BETA 2&#8230;and 3</title><link>http://fourwalledcubicle.com/blog/2010/08/lufa-100807-beta-2-and-3/</link> <comments>http://fourwalledcubicle.com/blog/2010/08/lufa-100807-beta-2-and-3/#comments</comments> <pubDate>Sun, 01 Aug 2010 14:40:55 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[LUFA (Formerly MyUSB) Library]]></category> <category><![CDATA[Projects]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=683</guid> <description><![CDATA[It&#8217;s been just under a week since I announced my little competition for free gear and, well, either I&#8217;m a fantastic programmer, or not many people are out testing the beta code. Knowing myself, I highly doubt the former and I&#8217;m much more inclined to believe it&#8217;s a case of the latter. Not to worry; [...]]]></description> <content:encoded><![CDATA[<p>It&#8217;s been just under a week since I announced <a
title="LUFA Competition" href="http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/">my little competition for free gear</a> and, well, either I&#8217;m a <em>fantastic</em> programmer, or not many people are out testing the beta code. Knowing myself, I highly doubt the former and I&#8217;m much more inclined to believe it&#8217;s a case of the latter. Not to worry; the brilliant people over at <a
title="Elektor Magazine" href="http://www.elektor.com">Elektor magazine</a> have offered to promote my competition to their subscribers this week! The Elektor editors have been especially generous, and have also made their <a
title="My First AVR USB Article Download" href="http://www.elektor.com/magazines/2010/january/my-first-avr-usb.1191175.lynkx">previously published article &#8220;My First AVR USB&#8221;</a> a free download for everyone, which features LUFA prominently. Thanks Elektor!</p><p>Over the last few days I&#8217;ve uploaded two newer betas for testing &#8211; BETA 2, which introduced support for low speed ISP in the AVRISP-MKII project, spell checked documentation and fixes to the USBtoSerial and Benito projects, and BETA 3 which introduces changes to the CDC Class driver APIs which has the potential to reduce program overhead, plus an improved version of the lightweight ring buffer used in several of the projects which reduces the time spent locking on atomic operations.</p><p>These new BETAs push us closer and closer to the release date, which is still subject to change based on the feedback I get, but is currently looking firm. Time will tell if there are any bugs waiting to be discovered, so download, test and report back today for your (currently 100%!) chance at winning a nice AVR programmer.</p><p>For 100807 BETA3 downloads and documentation, see the <a
title="LUFA 100807 BETA Download" href="http://fourwalledcubicle.com/LUFA.php">LUFA project page</a>.</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/08/lufa-100807-beta-2-and-3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Win a free ISP/TPI/PDI Programmer!</title><link>http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/</link> <comments>http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/#comments</comments> <pubDate>Tue, 27 Jul 2010 09:38:02 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[General]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=675</guid> <description><![CDATA[Where? That&#8217;s right folks! Only here do you get the chance to win one of three AVRISP-MKII clone programmers, ready made and shipped to you entirely for free! These three programmers are all the new V1.1a board revision of Tom&#8217;s excellent design and manufacture, worth US$33 each. Tom sent me one a few weeks ago [...]]]></description> <content:encoded><![CDATA[<h2>Where?</h2><p>That&#8217;s right folks! Only here do you get the chance to <strong>win one of three AVRISP-MKII clone programmers</strong>, ready made and shipped to you entirely for free! These three programmers are all the new <em>V1.1a</em> board revision of Tom&#8217;s excellent design and manufacture, worth US$33 <em>each</em>. Tom sent me one a few weeks ago to test out, and I&#8217;m so happy with it I thought I&#8217;d buy three from him and give them away here to LUFA users. This is the programmer I&#8217;m talking about:</p><p
style="text-align: center;"><a
rel="lightbox" href="http://fourwalledcubicle.com/img/Blog/USBTiny_Mkii2.jpg"><img
class="aligncenter" title="Tom's AVRISP-MKII Clone Programmer" src="http://fourwalledcubicle.com/img/Blog/USBTiny_Mkii2_thumb.jpg" alt="" width="344" height="222" /></a></p><h2>What?</h2><p>The USBTINY-MKII programmer features <strong>high speed ISP, TPI and PDI programming</strong> (for all 8-bit AVRs, including the new 6-pin TINY and the gigantic XMEGA chips) as well as<strong> native AVRStudio 4 compatibility</strong>,<strong> logic level translation</strong>,<strong> target powering from the USB bus</strong>, <strong>and easy firmware upgrades via the USB interface</strong>. At the core of the programmer is an AT90USB162, running my <a
title="AVRISP-MKII Clone Firmware" href="http://www.fourwalledcubicle.com/AVRISP.php">LUFA AVRISP-MKII firmware</a>. That means the programmer itself is open source, and you&#8217;ll receive future updates for it through the regular LUFA releases.</p><p>For more information of the <em>USBTINY-MKII</em> programmer, see <a
title="USBTiny-MKII Programmer Information Page" href="http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php">Tom&#8217;s website page about it</a>.</p><h2>How?</h2><p>How do you win one? Simple. Just submit a full bug report for a reproducible bug in the current SVN repository, LUFA 100807 BETA package or (eventually) the 100807 official release via email, and you&#8217;ll go into the draw. At the end of August, I&#8217;ll randomly select three bug reporters as the winners of one of these most excellent pieces of hardware. That&#8217;s it &#8211; you don&#8217;t even need to post a fix for the bug, just report it. The more new bug reports you submit, the more chances you have to win.</p><p>All eligible bug reports must be submitted to me before the 30th of August, 2010, and must contain full details of how to reproduce the bug, including the exact version/revision of LUFA, the hardware and software used.</p><p>You can download the current 100807 BETA and &#8211; when it is ready &#8211; official release from the <a
title="LUFA Project Page" href="http://fourwalledcubicle.com/LUFA.php">LUFA project page</a>. Happy hunting!</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/07/win-a-free-avr-programmer/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>LUFA 100807 BETA is out!</title><link>http://fourwalledcubicle.com/blog/2010/07/lufa-100807-beta-is-out/</link> <comments>http://fourwalledcubicle.com/blog/2010/07/lufa-100807-beta-is-out/#comments</comments> <pubDate>Fri, 23 Jul 2010 04:20:14 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=668</guid> <description><![CDATA[I finally feel the time is right to release the next public beta version of LUFA, scheduled for a full release on the 7th of next month &#8211; giving two whole weeks for me to complete the USB Test and Measurement Class code I&#8217;ve started (special thanks to Peter Lawrence for his amazing research into [...]]]></description> <content:encoded><![CDATA[<p>I finally feel the time is right to release the next public beta version of LUFA, scheduled for a full release on the 7th of next month &#8211; giving two whole weeks for me to complete the USB Test and Measurement Class code I&#8217;ve started (special thanks to Peter Lawrence for his amazing research into it) and for everyone else to download, test, and report back any problems.</p><p>This new beta contains a large number of internal changes, as well as the usual user visible improvements to the APIs, demos, projects and bootloaders. Bugs have been fixed, but I&#8217;ve also gone to a lot of effort to clean up sections of the internal library core code, so that (in theory, at least) ports to different architectures will be less difficult to achieve. There&#8217;s still some work to be done there, but the groundwork I&#8217;ve laid so far will mean that if the library does become targeted to multiple platforms, it shouldn&#8217;t become an (even bigger) gigantic pile of preprocessor macros.</p><p>Notably, I&#8217;ve converted over all the pseudo-functions used heavily in the library to real static inline functions. That gives several benefits &#8211; the documentation and code is now always in-sync, the static inline functions are properly type-checked and syntax checked at compile time, and the functions can be extended with more complicated implementations as needed when and if the library is ported to different architectures. Overall I&#8217;m quite happy with this, as it has already uncovered a fault in an obscure pipe interrupt macro, which has apparently been there since the dawn of time.</p><p>I implore everyone to please, <em>please</em> download, test and report back on the new beta version. The more issues that are uncovered now, the less issues that will be in the official release in two weeks. I hate seeing bugs in the release packages, as it means the fixed version won&#8217;t enter wide circulation until the following release, since most sane people don&#8217;t pull straight from the repository mirrors in production project code. I&#8217;ve uploaded the beta downloads and documentation to the regular <a
title="LUFA Project Page" href="http://www.fourwalledcubicle.com/LUFA.php">LUFA project page</a>, so that it will get maximum exposure throughout the beta testing window.</p><p>If you uncover <strong>any</strong> issue with the beta release, please let me know as soon as possible so that I have as long as possible to correct it.</p><p><a
title="LUFA 100807 BETA Download" href="http://lufa-lib.googlecode.com/files/LUFA-100807-BETA.zip">Direct download of the 100807 BETA package</a></p><p><a
title="LUFA 100807 BETA Documentation Download" href="http://www.fourwalledcubicle.com/files/LUFA/Doc/LUFA%20100807%20BETA%20Documentation.zip">Direct download of the 100807 prebuilt documentation package</a></p><hr
/><strong>New:</strong></p><ul><li>Added new ADC_DisableChannel() function (thanks to Mich Davis)</li><li>Added new VTARGET_REF_VOLTS and VTARGET_SCALE_FACTOR compile time  defines to the AVRISP-MKII programmer project to set the VTARGET  reference voltage and scale factor</li><li>Added new pgm_read_ptr() macro to Common.h for reading of pointers out of flash memory space</li><li>Added new SWAPENDIAN_16() and SWAPENDIAN_32() macros to Common.h for statically initialized variables at compile time</li><li>Added new Drivers/USB/LowLevel/Device.c file to house Device mode  specific functions that are more complicated than simple macros</li><li>Added new AVRStudio 4 project files for all library demos, projects and bootloaders</li><li>Added ability to set the serial baud rate via the user&#8217;s terminal in the XPLAINBridge project</li><li>Added new LUFA module variables for the different source modules in the core library makefile to simplify project makefiles</li><li>Added start of a new Test and Measurement class demo (thanks to Peter Lawrence)</li></ul><p><strong>Changed:</strong></p><ul><li>The RingBuff library code has been replaced in the XPLAINBridge,  Benito and USBtoSerial projects with an ultra lightweight ring buffer to  help improve the reliability of the projects</li><li>The EEPROM stream read/write functions now use eeprom_update_byte()  instead of eeprom_write_byte(), so that only changed bytes are written  to EEPROM to preserve its lifespan</li><li>Changed over the AVRISP-MKII and TemperatureDataLogger projects to  use eeprom_update_byte() when writing non-volatile parameters to EEPROM  to preserve its lifespan</li><li>Removed unused line encoding data and control requests from the CDC Bootloader code, to save space</li><li>Renamed SERIAL_STREAM_ASSERT() macro to STDOUT_ASSERT()</li><li>The USB_Device_IsRemoteWakeupSent() and USB_Device_IsUSBSuspended() macros have been deleted, as they are now obsolete</li><li>Rewrote the implementation of the SwapEndian_16() and SwapEndian_32() functions so that they compile down in most instances to minimal loads and stores rather than complicated shifts</li><li>The software UART in the XPLAINBridge has been largely altered to try to improve upon its performance and reliability</li><li>The USBtoSerial project now flushes received data via a flush timer, so that several bytes can be transmitted at once</li><li>Removed the automated checking of event names in the demo, project  and bootloader makefiles due to inconsistancies between the behaviour of  the command line tools used to perform the check on each platform</li><li>Internal USB driver source files renamed and moved to ease future possible architecture ports</li><li>All internal pseudo-function macros have been converted to true inline functions for type-safety and readability</li></ul><p><strong>Fixed:</strong></p><ul><li>Fixed AVRISP project sending a LOAD EXTENDED ADDRESS command to  128KB AVRs after programming or reading from the last page of FLASH  (thanks to Gerard Sexton)</li><li>Fixed AVRISP project not sending a full erase-and-write EEPROM  command to XMEGA targets when writing to the EEPROM instead of the split  write-only command (thanks to Tim Margush)</li><li>Fixed RNDISEthernet demos crashing when calculating checksums for Ethernet/TCP packets of more than ~500 bytes due to an overflow in the  checksum calculation loop (thanks to Kevin Malec)</li><li>Fixed XPLAINBridge project not correctly reading the XMEGA&#8217;s supply voltage when reporting back to the host</li><li>Fixed incorrect signature for the ATMEGA32U2 in the DFU bootloader (thanks to Axel Rohde)</li><li>Fixed internal device serial not being accessible on the ATMEGAXXU2 AVRs (thanks to Axel Rohde)</li><li>Fixed void pointer arithmetic in ConfigDescriptor.h breaking C++ compatibility (thanks to Michael Hennebry)</li><li>Fixed broken PDI EEPROM Section Erase functionality in the AVRISP-MKII project</li><li>Fixed USB_Device_SendRemoteWakeup() not working when the USB clock was frozen during USB bus suspend (thanks to Brian Dickman)</li><li>Fixed occasional lockup of the AVRISP project due to the timeout  extension code incorrectly extending the timeout in PDI and TPI  programming modes infinitely</li><li>Fixed HID device class driver still using PrevReportINBuffer for GetReport control requests even when it has been set to NULL by the user  application (thanks to Axel Rohde)</li><li>Fixed MIDI_Device_SendEventPacket() not correctly waiting for the endpoint to become ready (thanks to Robin Green)</li></ul> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/07/lufa-100807-beta-is-out/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>LUFA Feature Focus: Source Modules</title><link>http://fourwalledcubicle.com/blog/2010/07/lufa-feature-focus-source-modules/</link> <comments>http://fourwalledcubicle.com/blog/2010/07/lufa-feature-focus-source-modules/#comments</comments> <pubDate>Tue, 20 Jul 2010 03:30:55 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[LUFA (Formerly MyUSB) Library]]></category> <category><![CDATA[Projects]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=663</guid> <description><![CDATA[Last week I decided to download the latest Atmel Toolchain beta package from their rather well hidden beta site. This new toolchain is the spiritual successor to the WinAVR project &#8212; actually, it&#8217;s the same thing, except now it&#8217;s officially endorsed by Atmel, and it&#8217;s still being produced by the same guy. The new toolchain [...]]]></description> <content:encoded><![CDATA[<p>Last week I decided to download the latest Atmel Toolchain beta package from their <a
href="http://www.atmel.no/beta_ware">rather well hidden beta site</a>. This new toolchain is the spiritual successor to the WinAVR project &#8212; actually, it&#8217;s the same thing, except now it&#8217;s officially endorsed by Atmel, and it&#8217;s still being produced by the same guy. The new toolchain package contains updated <em>avr-libc</em>,<em> binutils</em> and <em>avr-gcc</em> versions, which means lots of bugs fixed, and new features to discover. One of the big changes to the new Atmel branded toochain package over the older WinAVR package is the presence of AVR32 versions of the tools; the one package now serves both the 8-bit and more powerful AVR-32 models. This means a single download serves the entire AVR lineup, reducing developer confusion.</p><p>So far, I&#8217;ve had a few teething troubles; the new Atmel AVR Toolchain package is missing a lot of the neat *nix tools that WinAVR included, such as <em>grep</em>. The existing makefiles of LUFA made use of these tools to process the source code to automate some tasks, but that&#8217;s now got to change. Biting the bullet, I&#8217;ve remade all of the LUFA project makefiles, so that with one exception (the main library core makefile&#8217;s doxygen target) these special tools aren&#8217;t needed anymore.</p><p>While I was at it, I decided to finally get around to doing something I&#8217;ve been wanting to do to the makefiles for a long time; make the core library makefile includable in the project makefiles. This has the distinct advantage of being able to inject extra common targets into the project makefiles as needed (say, to check for invalid events if I find a way to re-add it without the <em>grep</em> dependencies) but also the advantage of being able to list the module source files in the one place.</p><p>Why is this neat? It means that no longer do you need to care about what I call the source files inside the library core. I can now move and rename them as I see fit, and the user projects will still compile, providing they use the new &#8220;module source&#8221; names I&#8217;ve added to the makefile. Here&#8217;s an example of what the makefile source list use to look like for a typical class driver demo:</p><div
class="wp_syntax"><div
class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># List C source files here. (C dependencies are automatically generated.)</span>
SRC <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>c                                                 \
      Descriptors<span style="color: #004400;">.</span>c                                               \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>DevChapter9<span style="color: #004400;">.</span>c        \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>Device<span style="color: #004400;">.</span>c             \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>Endpoint<span style="color: #004400;">.</span>c           \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>Host<span style="color: #004400;">.</span>c               \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>HostChapter9<span style="color: #004400;">.</span>c       \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">.</span>c           \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>Pipe<span style="color: #004400;">.</span>c               \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>LowLevel<span style="color: #004400;">/</span>USBInterrupt<span style="color: #004400;">.</span>c       \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>HighLevel<span style="color: #004400;">/</span>ConfigDescriptor<span style="color: #004400;">.</span>c  \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>HighLevel<span style="color: #004400;">/</span>Events<span style="color: #004400;">.</span>c            \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>HighLevel<span style="color: #004400;">/</span>USBTask<span style="color: #004400;">.</span>c           \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>Class<span style="color: #004400;">/</span>Device<span style="color: #004400;">/</span>CDC<span style="color: #004400;">.</span>c            \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>Class<span style="color: #004400;">/</span>Host<span style="color: #004400;">/</span>CDC<span style="color: #004400;">.</span>c              \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>Class<span style="color: #004400;">/</span>Device<span style="color: #004400;">/</span>HID<span style="color: #004400;">.</span>c            \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>Drivers<span style="color: #004400;">/</span>USB<span style="color: #004400;">/</span>Class<span style="color: #004400;">/</span>Host<span style="color: #004400;">/</span>HID<span style="color: #004400;">.</span>c</pre></div></div><p>Which is, let&#8217;s face it, damned ugly and hard to maintain. Instead, here&#8217;s how the new system works:</p><div
class="wp_syntax"><div
class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># Create the LUFA source path variables by including the LUFA root makefile</span>
<span style="color: #666622; font-weight: bold;">include</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_PATH</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>LUFA<span style="color: #004400;">/</span>makefile
&nbsp;
<span style="color: #339900; font-style: italic;"># List C source files here. (C dependencies are automatically generated.)</span>
SRC <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>c                                                 \
      Descriptors<span style="color: #004400;">.</span>c                                               \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_SRC_USB</span><span style="color: #004400;">&#41;</span>                                             \
      <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LUFA_SRC_USBCLASS</span><span style="color: #004400;">&#41;</span></pre></div></div><p>Which is much neater &#8211; once the library core makefile is included (with the <strong>LUFA_PATH</strong> value set beforehand) the new module source names become available. In the documentation, just look for the module names rather than the source names, and add those as needed to your project makefile. Of course, you can still use your existing makefiles, but this new system means less restrictions on how I internally structure the library code.</p><p>Finished Bluetooth code or not, it&#8217;s about time I thought about releasing all the changes I&#8217;ve made to the project over the last two months, so I&#8217;ll be releasing a public beta version in a few days.</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/07/lufa-feature-focus-source-modules/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>XPLAIN Bridge Firmware Update</title><link>http://fourwalledcubicle.com/blog/2010/07/xplain-bridge-firmware-update/</link> <comments>http://fourwalledcubicle.com/blog/2010/07/xplain-bridge-firmware-update/#comments</comments> <pubDate>Mon, 12 Jul 2010 07:37:31 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[Uncategorized]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=661</guid> <description><![CDATA[Today I wasted a good portion of my day running around my University trying to get the forms I need for my Norwegian Visa application for my internship at Atmel in November. Ever seen the Hitchhiker&#8217;s Guide to the Galaxy movie, the scene where they try to free Trillian by filling out all the bureaucratic [...]]]></description> <content:encoded><![CDATA[<p>Today I wasted a good portion of my day running around my University trying to get the forms I need for my Norwegian Visa application for my internship at Atmel in November. Ever seen the <em>Hitchhiker&#8217;s Guide to the Galaxy</em> movie, the scene where they try to free Trillian by filling out all the bureaucratic forms, and are forced to line up several times, each time with a different form? Today was like that, but worse, since half the staff are away on leave during the mid-year break, and the remaining staff are on lunch break. After all my trouble, I&#8217;ve now got to go back next week and pick up my $25 form letter stating that yes, I am indeed a student at Latrobe. Bah.</p><p>Now, back to the good stuff. I believe that every programmer has an Achilles Heel, that one algorithm that everyone else seems to have no trouble with, but for that person it causes endless frustration and misery. For me, that algorithm is the implementation of a software U(S)ART. I&#8217;ve now written and re-written different implementations several times, and although they<em> eventually </em>work, my bidirectional software UARTs always seem to miss the occasional character.</p><p>A software UART is supposed to be a simple affair &#8211; after all, with the most common 8-bit, no parity, one stop bit setting that many devices use, each frame is just the raw bytes framed by a low start and a high stop bit. This translates to some fairly simple code, which is usually run in a timer ISR to ensure that the timing of each bit is constant, to prevent reception errors at either end.</p><p>A unidirectional UART is possibly the easiest algorithm to get working, with the exception perhaps of a software SPI port. It&#8217;s when the requirements are for a bidirectional software UART that things get hairy, since now you&#8217;ve got to work out how to prevent the bit transmission and reception ISRs from tripping each other up and delaying the other long enough to corrupt the transfer. This is needed in my <a
title="XPLAIN Bridge Project" href="http://www.fourwalledcubicle.com/XPLAIN.php">XPLAIN Bridge</a> firmware for Atmel&#8217;s XPLAIN board, when the bridge operates as a USB to Serial converter. Since the AVR&#8217;s hardware UART is instead used as the PDI programmer transport to the XMEGA chip on the board, the serial channel is instead implemented in software on the USB AVR side.</p><p>It&#8217;s not just me that&#8217;s had trouble with this algorithm however; recognizing that it&#8217;s not as simple as it appears I originally outsources the software UART code on AVRFreaks, and ended up with an ASM and a C implementation from two kind members there. Both of these worked, but things got wonky when both ends of the link tried to send at the same time, as the transmission and reception code blocked each other.<br
/> After some complaints about my less-than-perfect UART code, I took yet another crack at it last night, trying to fix up the implementation so that lost characters would be the exception, rather than the rule. This has led to <a
title="XPLAIN Bridge software UART code" href="http://code.google.com/p/lufa-lib/source/browse/trunk/Projects/XPLAINBridge/Lib/SoftUART.c">my new implementation</a> of the software UART, which uses two timers and an external interrupt pin. This new implementation uses one timer for bit transmissions &#8211; each bit period, either the next bit to send is transmitted, or the next byte to send is loaded into a temporary buffer so that it can be shifted out. The reception code relies on an external interrupt pin to sense the start bit, which then starts the bit reception timer to shift in the incoming bits.</p><p>Additionally, I found that the Windows CDC driver does not like mostly-empty incoming packets, even though it is quite happy to issue them to attached devices &#8211; I found my Windows 7 machine locking up when I barraged it with a constant stream of single-byte packets (one for each incoming character). This also lead to the reception buffer being overflown due to the host not processing the packets fast enough, which corrupted the incoming data stream occasionally. To combat this, the bridge code has a third timer which flushes the current reception buffer contents to the host in a single packet rapidly (30 flushes a second) to aggregate multiple bytes into a single USB IN packet.</p><p>Tests on the latest code show this new code to be far, far more reliable that the old, although large streams in both directions can still cause some issues. I&#8217;d like some more testers on this before the next official release to get a wider opinion on the new code&#8217;s performance &#8211; I&#8217;ve started uploading pre-built versions of the project to the <a
title="XPLAIN Bridge Project" href="http://www.fourwalledcubicle.com/XPLAIN.php">XPLAIN Bridge</a> project page for convenience.</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/07/xplain-bridge-firmware-update/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Something, Something, Title, Something</title><link>http://fourwalledcubicle.com/blog/2010/07/something-something-title-something/</link> <comments>http://fourwalledcubicle.com/blog/2010/07/something-something-title-something/#comments</comments> <pubDate>Thu, 08 Jul 2010 16:08:53 +0000</pubDate> <dc:creator>Dean Camera</dc:creator> <category><![CDATA[General]]></category><guid
isPermaLink="false">http://fourwalledcubicle.com/blog/?p=656</guid> <description><![CDATA[Something something AVR, something something Bluetooth, something. Sorry, I&#8217;m a little distracted today &#8211; it&#8217;s a special day! My girlfriend decided to show her baking prowess (and knowledge of the T1 line to my heart) through this creation: Has it been four years already? I think I need to go lie down. Regular programming will [...]]]></description> <content:encoded><![CDATA[<p>Something something AVR, something something Bluetooth, something.</p><p>Sorry, I&#8217;m a little distracted today &#8211; it&#8217;s a special day! My girlfriend decided to show her baking prowess (and knowledge of the T1 line to my heart) through this creation:</p><p
style="text-align: center;"><a
title="Four Year Anniversary Cake" rel="lightbox" href="http://www.fourwalledcubicle.com/img/Blog/Cake.jpg"><img
class="aligncenter" title="Four Year Anniversary Cake" src="http://www.fourwalledcubicle.com/img/Blog/Cake_thumb.jpg" alt="" width="400" height="300" /></a></p><p>Has it been four years already? I think I need to go lie down. Regular programming will return next week. For now, there&#8217;s cake.</p> ]]></content:encoded> <wfw:commentRss>http://fourwalledcubicle.com/blog/2010/07/something-something-title-something/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching using disk
Object Caching 481/541 objects using disk

Served from: fourwalledcubicle.com @ 2010-09-03 00:07:58 -->