View previous topic :: View next topic |
Author |
Message |
zathras Guest
|
Creating a USB memory stick function |
Posted: Wed Jul 01, 2009 12:49 pm |
|
|
I want replicate the functionality of a USB stick (plug it in, read/write to a FAT directory). I can get USB working as a terminal device (over the COM port), and I can read/ write to an SD card with FAT; how do I get it working as a memory stick?
Note: I am not trying to read a memory stick. I am trying to behave like a memory stick.
Thanks! |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Wed Jul 01, 2009 10:52 pm |
|
|
You need to create a Mass Storage Device Class, and implement it on the PIC. Which PIC are you using?
Rohit |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Jul 01, 2009 10:54 pm |
|
|
You have to build a mass storage class USB device that can be recognized by the host.
I'm not not aware of a respective CCS example. Microchip has an example project "Mass Storage - SD Card Reader" in it's package of USB application examples.
If you want to build the device from the scratch, there are several USB specifications involved (apart from general USB specification):
- Mass Storage - Class Bulk-Only Transport
- Mass Storage Specification For Bootability
- Mass Storage Class UFI Command Specification
Because memory commands are partly based on SCSI memory operation, it's also meaningful to know the respective t10.org specification.
Finally, watching an existing memory device in operation (e.g. by an USB sniffer) and checking against the own device is generally helpful to understand some oddities in host driver behaviour. |
|
|
zathras Guest
|
open to any USB PIC |
Posted: Thu Jul 02, 2009 8:33 am |
|
|
I haven't picked the PIC yet, I'm figuring any PIC with USB hardware should work okay. I'm open to any opinions.
I've worked with a lot of PICs including ones with Ethernet, this is my first attempt to a USB PIC. Previously I've used a separate chip to handle USB.
I'll start taking a look at the Microchip example. Thanks for the pointer. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Jul 02, 2009 12:04 pm |
|
|
Quote: | I'm figuring any PIC with USB hardware should work okay. | Quite right. The Microchip example is useable for PIC18 and PIC24. I think, you should choose the PIC according to your application requirements. |
|
|
|