PORTS Forum
Ports and Interfaces => USB => Topic started by: st2000 on September 09, 2010, 06:05:19 pm
-
Hi...
I confess: I'm new to USB (I've done the Microchip USB peripheral class if that counts!). And I'm really new to USB host coding. [Note, I do have a brand new copy of Jan's book! So I am set for any of this "Look on page 256 before you ask that again!".]
Where I'm at: I have the Microchip Explorer16 board running Microchip's USB thumb drive host demo code (yea!). And I have been able to transplant that code onto our hardware platform to repeat the feet (yea again!). But I think this is simple stuff (mainly because it's "canned" software that doesn't need much "massaging").
There is a media player on the horizon. We would like to send it new media from time to time but expect it to store files locally like a mass storage device. We would also like to control it. Simple commands like "start playing file <name>", "stop" and "are you done yet?". So we are thinking "let's put a USB interface on it"! But what will this device look like? Will it look like a mass storage device? Or like some sort of HID. Remember, we want to not only load it up with media but also control it. Maybe it needs to be a "compound device". Or maybe we can do all that control stuff and stay inside the definition of a mass storage device.
This is what I am missing, the knowledge needed to ask this question in the right manner. I am sure a USB interface can do all this and more. But I am not sure how to go about building the device and programming the host to do it.
Any suggestions which way to go from here would really be appreciated.
-thanks
-
Use a mass-storage interface for storing files and a HID interface for control. A device with multiple independent interfaces is a composite device. Microchip has a HID + MSD example.
Jan
-
Thanks Jan for the pointer to the MC sample/example project. I want ask more questions but will contain my self and do a bit of reading first...
well...,
ok,
I'm going to ask one question...
... if you want to do something a bit custom w/the, hummm, HID side of a composite device. Like control some buttons or something, in addition to working with the other composite device (the mass storage device). How would you going about that? I mean WRT the USB stuff (I know all about the electronic side, no help needed there). Like, where would you start tinkering with the software that controls & queries the HID device.
-thanks
-
All HID data travels in reports. You can define the reports any way you want. For example, the host application can display a control panel and send data to indicate what buttons the user clicked. Take a look at my HID host application, or Microchip's.
Jan