CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Creating a USB memory stick function

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
zathras
Guest







Creating a USB memory stick function
PostPosted: Wed Jul 01, 2009 12:49 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Wed Jul 01, 2009 10:52 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 01, 2009 10:54 pm     Reply with quote

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
PostPosted: Thu Jul 02, 2009 8:33 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 02, 2009 12:04 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group