Back to Basics

Misc., Projects No Comments »

After spending so long working on all the complications of USB, some times it’s just nice to get back to basics a little. Ask anyone new to AVRs (not “microcontrollers”, as that would include all the inbred PIC users) what they started out with and they’ll answer a blinking LED. Therefore through simple deduction, it can be concluded that the most awesome thing on the planet can be solved by the formula:

Awesomeness = LEDS x Frequency

Thus I’ve had a go at producing something a fraction of pure awesome; a simple LED matrix message scroller. It was a fun afternoon, after the rather unconfortable morning (getting my braces off for the second time), and it gave me a chance to use some of the gear that Matt over at AVROpendous sent me.

LED Matrix Scroller

Actually, I have to admit, I’m very impressed by the AVROpendous boards. Cheap, easily breadboardable and bare-bones, these are great little things for both USB experimentation, and just normal AVR development. You can see that my chaser actually uses an AVROpendous as both the processor and the power source (via USB) for the matrix. I think Matt’s designed a fantastic product which I hope people will latch on to; while it lacks the extras of the USBKEY (such as Dataflash, joystick, etc.) it is exactly that which makes is useful, as all the I/O pins are easily accessable and, of course, nothing stops you from adding your own more interesting peripherals. The on-board DebugWire connector pin, HWB and RESET buttons (similar to the USBKEY) and selectable 3.3V and 5V operation makes it a great starter board for all AVR users.

What are you waiting for? Go buy one already and try it out yourself!

Matt was also kind enough to send me a complete kit to build an AVROpendous from scratch so I can hone my surface mount soldering skills, but also some extra components to build Donald’s Benito boards that he sent me. With any luck I’ll have enough bits and bobs left over to populate the DorkBoards too. Whoopee!

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.

Yarr! Here be loot!

General 1 Comment »

It’s been a great week for my parts collection, with a few packages arriving recently. I’ve only got a few minutes, but I’ll give an overview of what I’ve recieved in the last week.

First up, I forgot to post an image of the boards I recieved from Donald Delmar Davis - (yes, that crazy guy, although to be fair that post was in response to the ongoing discussion here). I don’t have a macro camera around, so this blurry shot will have to do — for better photos, check out Donald’s blog posts here and here. Actually, on the same site another member has built the Benito and shares similar sentiments to mine - it’s damn tiny! The blue boards are Dorkboards (bare bones ATMEGA168 mounts) and the yellow are the USB “Benito” multi purpose boards, currently standing as a USB to Serial converter, SPI programmer and a MIDI keyboard.

Dorkboards and Benito Boards

Next, a package from SOC Machines. Larry was kind enough to send me two of their USB 10 boards (no link, as their site doesn’t currently mention it) and a “Ferret” ATMEGA64 board. The latter has a coin cell holder on the bottom, so it can be deployed in remote locations. I’m still trying to figure out how to hook up my JTAG to the USB10s so I can program their onboard AT90USB162s, but I’ll get there in the end. These look like great boards, and once the documentation becomes half decent I can see plenty of people giving them a go.

USB10 and Ferret boards

Finally comes my package I received tonight, from AVROpendous Inc., more specifically from Matt. Matt was kind enough to send me a whole bunch of neat parts, including one of his AVROpendous (AT90USB162 powered) boards, many different kinds of LEDs, a LED matrix, microphone, female headers for my USBKEY, crystals, capacitors, buttons, a breadboard and a whole bunch of other stuff. The AVROpendous board didn’t seem to like the trip through the courier much — I need to resolder the USB connector as it currently won’t enumerate to a host unless I use my thumbnail to ensure good contact between the board and the micro USB connector — but it really is a fantastic and simple bit of engineering. I can certainly recommend it to all those looking at low cost USB experiments, as it is very simple to prototype with, and has onboard HWB and RESET buttons just like the USBKEY.

AVROpendous Package

AVROpendous Board

While my current tasks are to fix up the MyUSB demos to ensure proper standards compliance, I also plan on writing a Bluetooth stack, which will combine with MyUSB to drive low-cost USB bluetooth dongles. Bluetooth modules are very expensive per unit, so by combining a low cost dongle with a low cost USB AVR, many people should be able to benefit. However, with all these fun packages arriving, I might take a short break and see what I can come up with using all the components I’ve received. If you have any project ideas, share them via the comments.

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