Composite USB device support

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
Jerry Messina
Swordfish Developer
Posts: 1471
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Composite USB device support

Post by Jerry Messina » Wed Oct 12, 2011 11:15 am

I recently needed a USB device that supported both HID and CDC classes (known as a "composite device").

While it ended up "doable" with the current USBv14 library, there were a number of changes I had to make to both the HID and CDC files to get it to work, and it's a bit of a kludge.

I've been thinking about updating the library to incorporate some of the features/fixes of the current Mchip one (which is up to v2.8 or v2.9 now), but I thought I'd get some feedback before I bothered doing that. The new library would make it easier to support things like composite devices, event callbacks, etc, but it's bound to be larger code-wise. I'd try to make as much of it optional as I can, but I know it'll be bigger. Is that an issue with most folks?

In addition to Composite devices, I'd like to be able to add things like a Mass Storage Driver and possibly a few others, and the structure of the current code just doesn't lend itself to that.

Would there be any interest? Any other features?

User avatar
Senacharim
Posts: 139
Joined: Tue Aug 10, 2010 5:19 pm
Location: Ventura, CA

Post by Senacharim » Wed Oct 12, 2011 2:09 pm

I've been wanting/needing to dabble in USB for awhile now--though my prime interest would be just getting the PIC to play host to a USB Mass Storage device.

To sum up: Interest? Yes.
Surviving Member
Bermuda Triangle Battalion
from 2026 to 1992

Voted "Most likely to time travel"--Class of 2024.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Wed Oct 12, 2011 2:22 pm

Are there even any PIC18's that can act as Host?
Why use 8 bits when you can have 32?
ARM CORTEX Rules!!! :D :D :D

User avatar
Senacharim
Posts: 139
Joined: Tue Aug 10, 2010 5:19 pm
Location: Ventura, CA

Post by Senacharim » Wed Oct 12, 2011 3:44 pm

rmteo wrote:Are there even any PIC18's that can act as Host?
Not yet that I'm aware of--but I'm always watching for it.
Surviving Member
Bermuda Triangle Battalion
from 2026 to 1992

Voted "Most likely to time travel"--Class of 2024.

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Post by bitfogav » Wed Oct 12, 2011 4:38 pm

You have my interest into the composite device and Mass Storage Driver.

Really appreciate all that you do Jerry :)

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Fri Oct 14, 2011 1:19 pm

Jerry, I've been interested in a USB bootloader for awhile now. Not sure if this fits in with your plans. Even better would be a mass storage class bootloader, where the new firmware would be loaded if a new hex file was present. I haven't had the resources (mainly time) to look into either of these.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

Jerry Messina
Swordfish Developer
Posts: 1471
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Fri Oct 14, 2011 3:35 pm

Ryan -

There's a USB bootloader in the current package.

It's a HID bootloader based on the ones from the Microchip libraries... I just combined all the different source packages into one and ported it over to SF so that you don't have to use C18 in case you have to make changes for your chip.

You can use the Mchip bootloader PC app, or I included a slightly modified version of that as well (MS Visual C++ 2010 Express)

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Sun Oct 23, 2011 10:45 am

Just to add where I am at with this...

I'm not a big fan of CDC. The MS drivers are a little weak and I prefer to avoid CDC whenever I can when designing a project. That said, I can of course see the value of CDC for many projects and designs. However, I try and use HID as much as possible and therefore value a 'focused' HID implementation.

Mass storage sounds really interesting though!

Jerry Messina
Swordfish Developer
Posts: 1471
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Sun Oct 23, 2011 11:44 am

Thanks for all the input so far.

I've been use HID more often too, so I'll make sure it stays reasonable to use. I'm thinking most of the changes can be optional, so hopefully no real impact if you don't want/need them.

As far as Mass storage goes, what kind of storage would folks like to see? SD card? External SPI flash? Internal flash?

I just got a number of projects dumped in my lap the other day (when it rains, it pours). It'll probably be a while until I get a chance to actually work on this, so keep the ideas coming.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Sun Oct 23, 2011 11:53 am

> As far as Mass storage goes, what kind of storage would folks like
> to see? SD card? External SPI flash? Internal flash?

I suppose if the actual storage medium was sufficiently decoupled from the USB then it would leave options open? However, I guess anything would suffice - for me, transferring large data sets over USB at good data rates (anything above HID ;-) would be great!

> I just got a number of projects dumped in my lap the other day...

I know that feeling!!! Been busy myself over the last month or so on some very interesting stuff, but sure is good when you get some time to play again ;-)

Post Reply