A sad realization

General, MyUSB Library, Projects No Comments »

It’s never nice to wake up in the morning and have the sad realization that you’ve mastered the task of being both incredibly boring and reasonably destitute. On the upside, it’s motivated me to fix myself one problem at a time, so I’m going to try to fix the easiest one first, by preparing a CV. Semester ends soon and I’ll be on holidays for about four months, which is a great time for those who need money to get a job. Two of my friends have recently bought the suprisingly cheap (for their sheer awesomeness) second hand HP TC1100 tablet laptops off eBay, and I’ve got a serious hankering to buy one. I need to either scrounge up a few hundred from somewhere or convince myself that I really don’t need something that cool, before I go crazy and explode in a puddle of murky goo.

I’ve tempoarily shelved last week’s project while I concentrate on getting MyUSB 1.5.3 out the door. So far I’ve only got some standards-compliance issues with the Mass Storage demo and some boot-protocol incompatibilities on some BIOSes in the HID demos to work on. For the curious, last week’s attempt was to make a Vista SideShow compatible device, so that I could display system, application and other notifications on an externally connected screen over USB. I must say that for once Microsoft has been caught out doing something innovative, although the published device specification SUCK HARDCORE. It’s about on-par with the Microsoft RNDIS specification — lots of missing details, typos, etc. which make life difficult when you’re trying to write a compatible device.
Despite all that, I managed to get it into a state where it will enumerate, and gadgets can be loaded onto it. The problem I had was in the XML parsing; writing a XML parser and some sort of user interface to navigate through the gadget would require more time than I’m willing to devote at present. For those with strong stomaches (the code isn’t complete, nor commented at this point) I’ve uploaded the current code to the MyUSB Support Google Group for download.

One of the real problems I’ve been having is that the SideShow API includes great capabilities properties which the device can report on, including whether on not the device can buffer content, whether it can display pictures and how large the screen is (amognst other properties). The problem is that neither the SideShow API itself nor any gadgets seem to query this information, resulting in me having to code around the host trying to send many content items at once, or trying to send images which the device cannot decode and display.

I think I’m comming down with the flu (or a bad cold) - so looks like I’ll be poor, boring and sick very soon - the ultimate trifecta of anti-popularity.

Project X

Projects No Comments »

Each time I start implementing a new USB class demo for my MyUSB project, it usually turns into a mini project in itself. For each class (such as Mass Storage, HID, CDC, etc.) there’s always a mountain of documentation to read, several swear-laden days of debugging and lots and lots of learning. Since I’ve started the MyUSB project it’s been over a year, and in that time I’ve become familiar with much more than just the USB standard — I’ve experimented with TCP/IP protocols including making my own basic TCP/IP stack from the ground up (RNDIS demo), I’ve learned how to write HID report protocols to create custom HID devices with all sorts of attributes (Mouse, Keyboard, Joystick demos), learned SCSI (Mass Storage), MIDI, PIMA (StillImage) and PWM Audio just to name a few. Looking back, I never expected such a simple sounding project to result in so many months of development and learning.

I’ve also become quite familiarized with Microsoft’s technique of throwing a new proprietary specification at any problem which they can’t easily solve with current standards. Actually, scratch that - they create new protocols and specifications for the sheer hell of it. Case in point the latest demo I’m working on, which makes use of “Microsoft OS Descriptors“. These are a complete abomination to the USB specification, “extending” the USB descriptors so that compatible functional IDs can be added to devices so that the host can use generic drivers for devices made by several vendors. Sound familiar? Yep, they’ve managed to re-implement the Class/Subclass/Protocol value fields of the standard descriptors, with the added “benefits” of being OS-tied and rather difficult to implement on both the host and device sides.

So far, this wonderful innovation has been used for only a (very) small handful of devices, most of which already have a defined Class/Subclass/Protocol codes which can be used instead, with the remainder being Microsoft proprietary classes. That’s fantastic - now the platform-agnostic USB has been extended to be completely OS dependant! If only Microsoft would implement the standard classes properly and completely rather than spending their days finding new tortures for me to code up, I’d be a much happier man.

All this brings me to the new demo I’m busy with as of today. While I won’t say what exactly it is at the moment (due to not being certain whether I will be able to finish it or not) I can say that it is a Vista-only innovation, but one of the few Microsoft innovations I do approve of. Well, the idea anyway, as the specification sucks harder than Epic Movie. Should I finish it I expect there will be a rather large interest from the home computer modder community in my project…

Flight of the Phoenix

MyUSB Library, Projects No Comments »

Today I finished reinstalling and re-configuring my laptop for what must be the third or fourth time since I bought it back in Feburary. While I’m uncertain whether to blame bad software, badly written drivers (whose flaws I’ve exposed through numerous USB tests) or just general instability, all I know is that I’m officially sick of downloading Windows Updates. Days of work wasted just getting everything set back up just the way it was!

Nevertheless, some good and bad news. First, the good - a new WIP (Work In Progress) version of MyUSB 1.5.3 has been uploaded to the support group. This new update contains the new Stream Callback API, which allows for custom callbacks to the stream functions to be written, so that in-progress stream transfers can be aborted early from a stimulus other than the ones written into the stream functions themselves. The stream functions have also been enhanced with the addition of timeouts, so bad transfers will no longer freeze the device.

Once the Mass Storage demo is confirmed to pass the USB-IF MS class device specification compliance tests, and once a few other things are fixed or completed, MyUSB 1.5.3 will be released. I’m happy with the way things are progressing with the new code — lots of bugs quashed and this will be the first release to certify (via the USB-IF compliance tester tool) full compliance to the USB 2.0, HID class and Mass Storage class specifications. There’s also a few neat additions to the library, including a new Dual CDC demo based on the Interface Association Descriptors I blogged about previously.

Now the bad: no bluetooth host for the near future. Putting aside the enormous amount of effort (possibly more than what has been required to write MyUSB itself) needed to write a full Bluetooth stack, there is a technical limitation. The Bluetooth HCI expects the USB host to be able to buffer up to 64KB of data at once before passing it on to the upper service layers, an amount of RAM which the USB AVRs certainly don’t have. While it may be possible to implement only certain services that can be forced to only send certain packet sizes, I don’t know enough about the Bluetooth architecture and specifications to be certain.

MyUSB 1.5.3 Focus, Office and More

General, MyUSB Library, Projects 1 Comment »

MyUSB 1.5.3 is well under way, with a release due exactly “when it’s done”. I don’t believe in setting concrete release dates and then either kill myself trying to meet a arbitrary deadline, or release substandard code. Until there’s a reason to fix a release date (e.g., for projects funded/contracted out by others) I’ll continue to try to release when I feel the current code base is ready.

To that end, the focus of the next release is mainly standards compliance. With all the noise I’ve made in the past (both on my blog, elsewhere and to my friends — forgive me Alan!) about forcing a painful death to all those who deviate from the standards, I’ve since discovered through use of the USBIF compliance tool quite a few bugs in the MyUSB library and demos’ implementation of the USB and class standards. This next release will hopefully fix that, with all devices now passing the Chapter 9 request compliance tests, and the HID demos passing the HID class tests. Mass Storage has a little way to go, with code needed to handle the infamous “thirteen cases” of wonky requests to the device. Once all the demos pass the relevant standards tests, 1.5.3 will be released.

The next MyUSB release will contain two “new” demos, which are actually just modifications of the current demos. The first is “KeyboardMouse”, a dual HID interface demo implementing both Keyboard and Mouse features to show off multi-interface single class devices. The second is “DualCDC”, which uses Interface Association Descriptors I wrote about previously to implement two independant CDC virtual serial ports in the one compound USB device.

On that note, I want to thank everyone who has contacted me about the library so far - knowing people are using it motivates me to keep improving it. I really appreciate the emails I get when people passionately describe what widget they are working on based on MyUSB. The latest email I’ve received is from Matt about his new AVRopendous project, a darn cheap open source/hardware AVR development board with a twist. The twist is a literal one, with the board mouting 90 degrees (perpendicular) to a breadboard, for easy prototyping. Matt’s promised to send me a couple in the mail, so I’ll be writing more about them when I get my hands on them. Assuming they arrive in the next week, it’ll be the first non-AT90USB1287 powered device I have to test out the library on, so I can ensure future compatibility with the smaller USB AVR range.

My thanks to everyone who has donated to me so far. University is a full time commitment, so the only work I can do is small contract jobs. Having people donate to show their appreciation helps me out quite a bit. Actually, I think that making the library MIT licensed was a great decision, as it helps get my name out in the wild for future jobs.

A few days ago, I recieved word that the Bluetooth organization has released their specifications publicly for free, rather than to members-only (which it used to be, as far as I can remember). I’ve downloaded the Bluetooth 2.0 and the Bluetooth USB transport standards, which I’ll hopefully be able to implement on top of MyUSB. Commercial Bluetooth modules are usually either raw HCI or fixed Serial class only, and are frightfully expensive, while HCI USB dongles are only $4 or so each. If I’m able to create a Bluetooth stack that runs on the USB AVRs, this will drive down the implementation cost to under $10 or so per unit and (as an added bonus) the resulting device will not need to undergo any wireless testing as the pre-tested and sealed dongle would be used as-is. Once I start on that, I’ll branch it off as a seperate project that ties into MyUSB and make it GPL, with alternative licensing avaliable for a small one-time fee.

As a final bit of news, last Fridat I purchased a legitemate license of Microsoft Office 2007 Ultimate (RRP ~AU$1300) for the princely sum of AU$79. I actually REALLY like the updated ribbon interface, as it makes every task easy to find and use, unlike previous versions. The special University student-only offer was first made avaliable last year over at It’s Not Cheating, but I missed it the first time. Checking back last week shows that it’s once again back on, so I bought a license key. If you are an Australian TAFE or University student, you are most likely elligable, so go grab it before they kill it off again!

Actually, if one was not clued on to these things, one would dismiss the site as a scam, due to the stupudly low price and the currently non-functional “Click here for proof” link. Microsoft’s really boned it by not fixing up the site so that it provides adequate verification, but last year when the site was first up it had all the proof one needs (including a page on the official Microsoft website about the offer and the site). The proof is still available on the Microsoft site - but now one has to search for it manually rather than clicking the link on the purchasing site. At any rate, other than the dumb form only showing US states and not Australian states, it all works like a charm and now I’m the proud owner of the latest version of Microsoft Office.

Dorkboards and Benitos

MyUSB Library, Projects 1 Comment »

Interesting week, last. I received in the mail a nice package from Donald Delmar Davis containing two of his “DorkBoard” and three “Benito” boards. The former is a very nice looking “bare bones” MEGA168 board for rapid firmware development, belonging to the “Adurino” movement which has been getting a lot of press and popularity these last few months. I’m actually quite thrilled by Adurinos, as it is *very* nice to see an AVR based design being placed into the hands of potential engineers and hobbyists rather than overpriced, underpowered, PIC based BASIC stamps. Bleah.

The board is an unusual blue color, which I rather like - it’s a nice change from the standard copper-on-green PCB that is the norm. After I manage to get a hold of some surface mount discretes, I’ll be making them up to play with.

The Benito boards are what really capture my attention however. While I’ve been reading up on Donald’s project over on his blog (including the posts about using it for its original purpose of an Adurino board programmer as well as recently a USB to Serial dongle and a USB to SPI/ISP programmer) I never really appreciated one critical aspect of the design, how damn small it is. Seriously, these things are only a tad smaller than Smiley Micros’ aptly-named USB Thingy (itself about the size of a thumbnail), which is a FTDI based USB to Serial converter, yet are incredibly flexible due to being AVR rather than proprietary chip design based.

I’m currently looking for a cheap source of three AT90USB162 surface mount ICs so I can get the boards up and running, since purchasing them from places such as Digikey are very expensive for only a handful of parts. If you have two or three of these lying around and are willing to sell for the right price, please contact me via email or leave a comment.

I’ve only done one surface mount board in my life, so the Benitos scare me. However, the best way to practice is to do it and do it repeatedly, so these should be a learning experience in more ways than one.

I’ll post photos of the boards when I can figure out how to get the camera set up for macro shots when I get home tonight. For now, check out the Dorkbot PDX site for photos of the boards, or (even better) buy some yourself.

MyUSB now has a seperate bug tracker set up, for reporting MyUSB bugs and feature enhancement requests. This is to complement the general project support and discussion group I set up last week. Please use the tracker as much as possible, so I don’t miss or forget your requests and bug reports!

As always, I’m certain I’m forgetting some piece of recent and exciting news. Stay tuned for more when I inevitably remember what it was.

MyUSB Projects

Misc., MyUSB Library, Projects No Comments »

Thanks to all who’ve been sending me word on where MyUSB is ending up. I really get a kick out of seeing it incorporated into some very interesting projects, and I’ve been adding links to the projects I know of on the MyUSB project page.

Congratulations to Sean D’Epagnier for getting his Magnetometer mouse sold on Sparkfun. Sean was kind enough to send me a free unit partially for my help getting the MyUSB powered portion of the device working, and partially so I could test out the device in the sothern hemisphere. I posted a small rundown of the device previously, but go check it out again if you missed it the first time. It’s quite a neat product, and works a little like a tethered Wii controler, in that roll, pitch and yaw of the device controls the cursor on the screen.

I was alerted yesterday to another project built with the MyUSB library, however unfortunately for me the site for it is written in German. A quick Google translation later and I now have the jist of the project - it’s a 868MHz wireless protocol analyzer powered by an onboard AT90USB162 AVR microcontroller. I haven’t the faintest idea what the 868MHz band is used for, so if you are more clued in than I, please leave a comment.  The dongle looks quite professional, and no-doubt is being heavily used by whoever it is that uses 868MHz communications. I look forward to being illuminated on its exact purpose.

I’m also pleased by the number of members who have signed on to the new MyUSB Support Google Group in the last week. There’s already been a bit of good discussion about the project (or topics related to MyUSB in some way) so I do suggest that all those interested come and join in — you might learn something!

Currently in my idle time at University between classes I’m investigating Ray Tracing, by writing a simple ray tracer in Java. Once I get my spheres lit by some proper lighting via rays traced from the primary ray/sphere intersection I’ll post some screenshots. For now, it’s just a lot of uninteresting multicoloured spheres.

VHD(hel)L

General, MyUSB Library, Projects, University 3 Comments »

I found an interesting presentation today from the “Sketching in Hardware ‘08″ conference, something of which I’ve never heard before. I find the presentation interesting for many reasons, but one of them is definitely the mention of MyUSB - and there’s a nice looking USB board in the presentation too, which presumably uses MyUSB (since the library is mentioned). It’s nice to see even a little momentum being built up about MyUSB, as the more people using it the happer I become.

Since he seems to be bursting at the seams, I’ll also put another mention to Casainho’s Bicycle POV project over on Google Code. While the use of MyUSB is ancillary (used as a command and data transport from the host) the project itself is quite spectactular, and the latest pictures of the finished prototype boards are top-notch. All the best to Casainho, and I only ask that he take a picture of the final design showing a MyUSB/FourWalledCubicle themed picture ;).

Actually, It’s been an interesting week. On Sunday night I battled over timezones with another user, to help him get the MyUSB Mass Storage demo working on his custom AT90USB162 board. It turns out I’ve done the dumb thing of making the endpoints in the demo double banked (why do I keep doing this?!) which doesn’t work in that situation on the AT90USB162. Writing demos that work across the full USB AVR range is difficult when I only have an AT90USB1287 handy, but hopefully that will change in the near(ish) future and I’ll be able to fully test out the demos.

In lieu of payment for my assistance on Sunday, the user has agreed to send me a few of his custom boards. The boards themselves are (deliberately) simple - they’re actually business cards which will have my name, contact details, website and the like printed on them, with my resume and a few odds-and-ends located on the card’s dataflash, accessable when plugged into a computer over USB. It seems like a rather cool idea in my mind — a business card where the firmware of the board itself is an example of my skills — which is why I agreed to grab a few. Now all I need to do is figure out what to put on the card’s 1MB of space, other than my resume, picture and contact details. I’ll post pictures of the cards when they arrive, but the user should be posting his own information about them on AVRFreaks soon.

It also seems that the MassStore demo is broken on XP, but not for the usual reasons. The demo itself works fine as a disk — but Windows XP refuses to format the dataflashes if they’re not already formatted (which they are from the factory on Atmel’s demo boards). This is due to XP requiring the implementation of a few SCSI commands marked as non-mandatory, which nevertheless cause problems if not present. Fortunately I have backups of the old code in my local SVN and was able to re-implemented the needed SCSI commands, which are simple dummy handlers anyway.

This semester we’ve move on from blasphemous TI microcontrollers into the exciting world of CPLDs. That means I now have to learn the VHDL language, something I’m already hating. VHDL, in my experience, looks like the illegitemate inbred offspring of C, BASIC and Delphi. So many well established syntax patterns are broken in the language it makes my head hurt, and my body wish for a more C-like language for the chips.

My First Magnetometer

General, MyUSB Library, Projects 1 Comment »

Two days ago I received in the mail a nice shiny new toy, courtesy of Sean D’Epagnier over at www.digitalsurveyinstruments.com - a new magnetometer/pointer device. Powered by MyUSB, this little critter can serve either as a “3D mouse”, where the computer’s mouse pointer moves according to the rotation of the device, or as a magnetometer sensor which can collect readings for curiosity, amusement and (possibly) legitemate survey uses.

Magnetometer Case

Magnetometer Internals

The design and quality of the device is top-notch, and it’s a blast to play with - although not without the occasional bug as the system is still in development. I’m quite excited to play with a real, proper design made from MyUSB, and all the more excited about just how damn neat the thing is.

Sean’s been busy working on both this and the larger, full magnetometer design, with mountains of firmware to dig through on his site along with schematics, documentation and a host-side communication program. Following the lead of other designers the unit can be put into CDC mode, enumerating as a virtual serial port for terminal-like control over the settings and status of the device through either Sean’s custom program, or through a standard serial terminal. This flexibility allows other software to interact with the device easily through standard serial APIs, which makes porting or creating compatible programs a much easier task than a custom USB interface with custom driver would afford.

I haven’t had much of a chance to really play with this thing yet other than use it to control my mouse and surf the web, so it’s going to be a fun couple of days.

MyUSB 1.5.2

MyUSB Library, Projects 1 Comment »

This month’s “bizzare search terms which found this site” award has to go to whoever searched for the words “hack the gibson monkey” and found my site. Yes, I did mention all those terms on my blog at some point, but I’m still amazed that someone would be looking for websites about that…

MyUSB 1.5.2 has been released. This new minor release is *very* minor, only correcting one big mistake in the device chapter 9 handling code and enhancing the RNDIS demo to have a working (barely) TELNET and webserver for users to try out. Keep in mind that my TCP/IP implmentation isn’t the greatest — I wrote it as I learned about each layer — and so for proper projects it should be ripped out and replaced with a proper stack, such as Adam Dunkel’s uIP TCP/IP stack for embedded systems.

The real reason to release the new version with so little changed is because of the new licence. Denver Gingerich has agreed to relicence his portions of the library under the same new MIT license, so the latest release reflects the changes to the new open source license. I hope the change will appease the masses, including those shifty Germans who were suggesting that others use earlier library releases where the LGPL licence wasn’t strictly enforcable due to my failure to state the license restructions in every source file.

The changelog for the new version as as stated very minor, but reproduced for completeness:

  • Fixed SwapEndian_32() function in Common.h so that it now works correctly (wrong parameter types)
  • Updated RNDIS demo - notification endpoint is no longer blocking so that it works with faulty Linux RNDIS implementations (where the notification endpoint is ignored in favour of polling the control endpoint)
  • Fixed incorrect Vendor Description string return size in RNDIS demo for the OID_GEN_VENDOR_DESCRIPTION OID token
  • Added very basic TCP/IP stack and HTTP/TELNET servers to RNDIS demo
  • Fixed DFU bootloader exit causing programming software to complain about failed writes
  • Fixed DFU bootloader EEPROM programming mode wiping first flash page
  • Fixed Clear/Set Feature device standard request processing code (fixing MassStorage demo in the process)
  • Added support for the ATMEGA16U4 AVR microcontroller
  • Library licence changed from LGPLv3 to MIT license

Notice there’s no migration information in the documentation, the reason for which is twofold:

  1. I forgot to add it in before uploading the files
  1. There isn’t any for this release anyway

So that should cement the devision to upgrade, as existing code will work *exactly* as it is with no changes whatsoever. That means no excuses for using older versions!

Also added in the new library as shown in the changelog is support for Atmel’s just-announced ATMEGA16U4 microcontroller. I only saw the new datasheet last night, but due to it’s similarity to the ATMEGA32U4 the changes required to implement it were extreamely minor. With any luck, someone will be able to test out MyUSB on either/both models when the silicon eventually starts shipping later this year.

Tomorrow I’ll be posting about my new magnetometer toy I received, powered by MyUSB…

MIghTy improvements

MyUSB Library, Projects, University No Comments »

Good news to all MyUSB fans! As of now, MyUSB is now retroactively released under the following permissive MIT license:

Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness.  In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.

Which is a great step forward to getting the library into more commercial (and non-commercial) products. Essentially, this allows myself to retain the copyright and credit for my work, but allows the library to be integrated into commercial products without source code disclosure. This change will be visible in future library releases, however the above license now applies to previously released versions (including but not limited to the current release) with the exception of the Keyboard device demo and demos derived from the keyboard device demo. This exception is due to the keyboard demo being contributed by Denver Gingerich over at OSSGuy rather than myself, thus I do not have the power to relicence his contributions.

This exception may also (depending on Denver’s response to my enquiry about relicencing his portions) extend to the next release, but more will be known later.

University’s back on again and I’m going to be as busy as ever. Still, I appreciate all the feedback and questions I get by email, so don’t hesistate to drop me a line. If you’re an avid MyUSB or ButtLoad fan and want to give back to the developer (*ahem*, me!), don’t forget that I accept donations of any amount on my site via PayPal. Such donations allow me to get new toys for development and allow me to buy shiny things  while I slave away at Univeristy, so a big thanks to all those who have donated so far!

Ok, that’s my begging spiel over. Now on to the next related topic - an AVR32 MyUSB port. One of the guys behind this interesting MyUSB powered project contacted me this week enquiring about a port of MyUSB to the AVR32 line of AVR microcontrollers from Atmel. After having a look at the datasheets - I’ve not had access to any AVR32s yet - I’ve determined that it *may* be possible to expand MyUSB to support the UC3B (not the UC3A) microcontrollers using the same (or near identical) API, since the former has a USB controller very similar to the 8-bit USB AVRs.

Before I begin work on such an expansion, I’d like an interest check. If you are interested in an AVR32 UC3B series port of MyUSB, please send me an email or leave a comment so I can assess whether it is worth the development effort or not.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in