New device support

LUFA (Formerly MyUSB) Library, Projects No Comments »

Since the AT90USB1286, AT90USB646 and AT90USB647 are very similar to the AT90USB1287 the MyUSB library is written for, I’ve added support for the new devices. The AT90USBx6 variants are identical to the AT90USBx7 variants, except they do not have a host controller — the library implicitly selects USB_DEVICE_ONLY when a AT90USBx6 project is built.

I need the assistance of someone with other USB AVR variants to test out other ports I make, as I do not have access to other USB AVR models. If you’d like to help get MyUSB ported to other AT90USB series AVRs, please leave a comment or email me.

MyUSB is now nearing a stable 1.0 release stage. Only a few more things left to complete.

Happy new year everyone!

Get a Handle on Life

LUFA (Formerly MyUSB) Library, Projects No Comments »

I’ve scrapped the Audio Host project - I couldn’t get the blasted microphone to send any samples. The project is complicated by the sheer number of possible configurations - both audio unit internals (feature units, mixer units, etc.) as well as sample rates. No matter, at least I was able to send samples to the headphones, and I discovered the truncation problem in the host control request code previously mentioned.

I’ve added in my new DynAlloc library to MyUSB. It’s a dynamic, auto-defragmenting memory allocation library, which I think is pretty neat. Check out the latest MyUSB version for the code.

I’ve also been working on a commercial product, involving the DB101. Atmel’s library is actually quite neat and powerful, so it’s developing much faster than I expected. Score one for rapid software development via library use.

And so that was christmas…

LUFA (Formerly MyUSB) Library, Projects No Comments »

Christmas over, 365 (leap year!) days to go. I fared quite well - apart from receiving the majority of the episodes of Stargate ever made on DVD, I also got a nice Logitech USB headset with noise cancelling microphone. While my bandwidth won’t reset until the 3rd of next month, I’ve created a new Skype account (username dean.camera) which I’ll be using to presumably talk to people across the globe about AVRs, programming, electronics and what-not. I’m damned shy, but if you don’t mind talking to a meek teenager, add me!

Since the headset’s USB, I couldn’t resist starting a USB Audio Host demo for MyUSB. That was actually a good idea - it helped me uncover a problem in the host control transmission and reception code, which was truncating the number of bytes to be transferred from an int to a char, causing lost data. That one threw me for a loop - isn’t GCC supposed to warn against truncation for types it knows at compile time when -Wall is used?!

I need to start work on the OTG portions of the library, but for that I need a second AT90USBKEY. I certainly can’t afford the AU$45 needed to get one from online Australia stores, so if you have an old but working board you want to get rid of, make me an offer for the board and shipping to Melbourne, Australia.

Also, if anyone wants MyUSB ported to a particular USBAVR flavor, I accept hardware donations. Even if it’s just a particular USB-AVR mounted on a breakout board, I’m happy to do a port if I receive the necessary hardware to test it out on.

Merry Christmas!

LUFA (Formerly MyUSB) Library, Misc., Projects No Comments »

Well, twenty four hours premature. But still - if you visit here tomorrow, you need to heap-sort your priorities!

I’m now convinced that the Mass Storage Host code is correct, with the addition of a new function to wait while the device is busy. It seems the correct method is a spinloop, looking for NAK signals on the BULK IN data pipe. Calling the new function before any read or write operations now causes them to work just fine, rather than the code locking up (while waiting for the data response from the device that won’t come) after more than one operation is executed within the time it takes the device to get ready for the next command.

Today and late last night I coded up something which I dreamed up while riding in the car - an auto-defragmenting, dynamic memory block allocation library. It’s operation is quite simple from an algorithmic standpoint, but the end result is a nice dynamic memory allocator with no fears of memory fragmentation after a long period of time. I’ve posted the initial version of the code over in a thread at AVRFreaks.

Happy holidays!

Mass Storage Host Demo Complete

LUFA (Formerly MyUSB) Library, Projects No Comments »

Eagle-eyed observers will notice that the Mass Storage demonstration is no longer listed as incomplete on the MyUSB page of my Website. That’s because I finally got it operational last night, after some shifting around of the pipe freezing for the data pipes. I’m not entirely convinced that this is a fix rather than a mask for the problem, so I’ll be looking into the correct way of recovering from Device NAKs this week.

The Mass Storage demo is designed to be a basic example, so there’s no FAT handling code - it will just read and write blocks of data from and to the device with no respect for any existing filesystem. The write and read routines are seperate however with useful parameters, so chances are they could be slotted into an existing file system driver.

I’ve had an email requesting I look into the Test And Measurement USB device class, which I’ll also be doing this week. Sounds interesting (and related to the kinds of end-applications for MyUSB) and I’ve not heard of it before, so I’m keen to investigate.

Back to Work

LUFA (Formerly MyUSB) Library, Misc., Projects 1 Comment »

Yesterday I started my latest contract work, based on the new DB101 board from Atmel I reviewed here previously. It’s my first time programming the board; my interactions with it until now have been restricted to using the default firmware’s terminal mode as a micro-debugging terminal.

I have to say, Atmel’s done a good job with the code. The widget library has a few eccentricities that I had to track down and fix (you can select the title of a dialog with the cursor, for instance) and new features to add (non-selectable spacers when blank strings are passed to a choice menu) but it’s been pretty usable. My only gripe is that it doesn’t seem possible (or at least easy) to display icons or pictures simultaneously with forms — the two are incompatible using the Atmel widget/form/image libraries and will require some hacking on my part.

I’m back to working on the MyUSB Mass Storage Host code, the last demo I have planned for the library at the moment. I fixed some issues with the host samples and the library that was causing unforgivingly standards compliant devices issues (I’m looking at you, Toshiba USB memory stick!). That means I can now get the same behavior with two different memory sticks of mine, rather than seperate behaviors. It still doesn’t work mind, but I’m getting closer with each code edit and debug session.

Also changed in the library, is that the API for sending, checking and receiving data in both endpoints and pipes has been changed over. Previously it was all done by the In_Clear/Out_Clear/etc type macros, which worked for both control requests and normal IN/OUT requests, but wasted flash memory. Now they are seperate Setup_In_Clear/Setup_Out_Clear/etc and FIFOCON_Clear macros which means smaller code usage, and more technically-correct code.

New MyUSB license

LUFA (Formerly MyUSB) Library, Projects No Comments »

Previously I’ve toyed with the idea of trying to earn some money for myself (poor University student, and all that) with my MyUSB library, by selling commercial licenses. However, I’ve decided - in part due to Eric at Atmel/AVRFreaks - to release it under the LGPL instead. This new license allows for proprietary applications to be developed using the open-source library, without the public release of said application. It does however, like the normal GPL license, require that any enhancements to the MyUSB library itself be made public free of charge.

I’m hoping this move will convince more people to get on board with MyUSB. A very generous licence like the LGPL makes the project more attractive to both commercial and hobbyist users alike.

New Sever, New Demo

LUFA (Formerly MyUSB) Library, Projects, Website No Comments »

Thanks to Angus, my younger and richer peer on AVRFreaks, my site is now hosted on a newer and faster server. That should reduce bottlenecks and prevent popular files like the high-resolution DB101 photos I posted from killing the site response.

Although it’s most unlike me, I decided to give up on getting the Audio Out feature unit working. It’s not really needed anyway; it just means that there is no master controls for the USB speaker - the individual mixer sources are still changeable. It’s only a demo after all, and I had run out of ideas as to how to solve the problem.

As a bit of good news however, with the completion of the Audio Out project (which now supports mono mixed, stereo and LED output modes) comes a similar but subtlety different Audio In project. This demo shows the library being used as an audio in source, a USB microphone.

I’ve just about run out of library demo ideas (feel free to comment with some!) so with the completion of the USB Mass Storage Host demo, I will focus on fixing all remaining bugs and missing features, then release it as MyUSB 1.0. The demo list now is quite impressive if I do say so myself:

  • Audio In Device
  • Audio Out Device
  • CDC Device
  • General Library Test Application
  • Joystick Device
  • Keyboard Device
  • Keyboard Host
  • Keyboard Host (Using Pipe Interrupts)
  • Magnetic Card Reader Device (based on Keyboard demo)
  • Mass Storage Device
  • Mass Storage Host (INCOMPLETE)
  • Mouse Device
  • Mouse Host
  • Mouse Host (Using Pipe Interrupts)
  • USB-RS232 Device (based on CDC Device demo)

I can hear (semi-)clearly now…

LUFA (Formerly MyUSB) Library, Projects No Comments »

After a lot of work, I’ve now got the USB Audio Out project into a working state. It’s not completely finished just yet — the mixer controls don’t work, preventing the volume or mute settings from being changed — but with the attachment of a speaker and capacitor to the USBKEY sound can be heard in all its 8-bit glory.

I’m actually quite excited about this demo - as far as I know, I’m the first to do with a USB AVR. Sure, Atmel’s got a Mic In project (which I need to make my own incarnation of next) but audio out is new and interesting.

I’d like to thank the fellow AVRFreaks members who’ve helped me thus far - both for the Mass Storage (especially Joerg, the veritable fountain of knowledge he is) and the Audio Out project. Especially in the latter case, I would have been at a loss as to how to correctly PWM the audio output in a recognizable form.

Also a big round of applause for James, also from AVRFreaks, whose been doing the Linux testing of all the MyUSB demos. He also found a small bug in the Mass Storage device demo, which means it now works under Linux. A big cat /dev/kudos to him!

Red Herring

LUFA (Formerly MyUSB) Library, Projects 1 Comment »

I’m ditching the USB Mass Storage host for now, while I wait for a response from an Atmel engineer. I can’t seem to figure out the problem; the flash disk device is returning a NAK on the bulk IN data endpoint in response to any commands sent on the bulk OUT endpoint. It’s either a power issue, or something more fundamental I’m missing such as a control request I need to issue before the device will start responding.

Today I worked on the Audio Out device, and have finally got somewhere. After a number of bluescreens, and an unimaginable amount of uttered explicatives, I found the source of the problem which was causing the device to bluescreen. After countless revisions of the configuration descriptor for the device (which weren’t entirely fruitless, as I did find and fix a number of issues) I started looking elsewhere. Turns out I managed to completely forget the minor SET INTERFACE control request handler in the library code, which was required by the Audio driver in Windows because the Audio Out project supplies multiple interfaces. Adding that now causes the device to enumerate as a USB Audio device, although I can’t seem to select it as an output device yet in the audio mixer.

If anyone out there uses Linux and can provide me with a formatted, interpreted descriptor dump similar to the one found on this page, I’d like to hear from you. Having such a dump might alert me to clues that I can’t easily see just from studying my code, and Windows lacks such an ability.

In addition, if anyone can enlighten me on what is required to set up an audio hardware device as a mixer output, I’d also appreciate an email. I don’t know how to get from valid USB Audio device, to a mixer output in Windows so that audio can be streamed to it.

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