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 CCS Technical Support

PIC18F2550(USB) + SDCARD + FAT + WINDOWS

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



Joined: 12 Dec 2005
Posts: 50
Location: Curitiba - Brazil

View user's profile Send private message Send e-mail

PIC18F2550(USB) + SDCARD + FAT + WINDOWS
PostPosted: Mon Aug 21, 2006 7:40 am     Reply with quote

MPLAB 7.1 CCS 3.235

Hi all,
I have a PIC18F2550 connected to an SDCARD by the SPI interface. I want to connect the SDCARD to the PC to be used as a PEN-DRIVE, USB interface.
How can I do this ? I can implement FAT12/16 or 32 to the SDCARD, but how do I translate data from the card to the PC ? How will I receive data fromthe USB/PC and read/write it to the files in the card ?
I have some experience with USB as a serial interface but not as a memory.
Any help, advice or example codes are wellcome.
Thanks in advance,
Pasini
Ttelmah
Guest







PostPosted: Mon Aug 21, 2006 9:54 am     Reply with quote

If at the PC end, you are going to use an existing USB interface to a 'Pen drive', as a 'mass storage' device, then the PC, will already be handling FAT. If you want the PC to access the device as sequential 'memory', then you will need to think again about what USB device you implement. If the SDCARD, does not ever need to be readable by a PC directly, and you want to modify the data from the PIC, as well as handling the 'pass through', then you would find it much simpler, to interface a bulk I/O device, and write to the card using your own format, rather than FAT.

Best Wishes
pasini



Joined: 12 Dec 2005
Posts: 50
Location: Curitiba - Brazil

View user's profile Send private message Send e-mail

PostPosted: Mon Aug 21, 2006 10:07 am     Reply with quote

Actually, the SDCard memory will be a pen-drive. PIC MCU will not need to read/write any other kind of data.
My project has a RS232-to-USB serial interface in one USB logic channel, working as an Communication Device Class. Ok, this is working.
The other part is the SDCard memory that will be a pen-drive. in this case, I need a FAT-12/16 or 32, ok ? But how do I receive data from the computer, and how do I read/write to the memory ? The card is in SPI mode.
Thanks
Pasini
dmendesf



Joined: 31 Dec 2005
Posts: 32

View user's profile Send private message

PostPosted: Mon Aug 21, 2006 10:19 am     Reply with quote

You need this book:

http://www.powells.com/cgi-bin/biblio?inkey=61-1931448043-0


USB Mass Storage: Designing and Programming Devices and Embedded Hosts by Jan Axelson
sjbaxter



Joined: 26 Jan 2006
Posts: 141
Location: Cheshire, UK

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

PostPosted: Tue Aug 22, 2006 4:09 am     Reply with quote

Have a read of Microchips Application Note:

USB Mass Storage Device

it should give you some ideas.

The schematics and sources are all available if you hunt around on the Microchip site.
_________________
Regards,
Simon.
ratgod



Joined: 27 Jan 2006
Posts: 69
Location: Manchester, England

View user's profile Send private message

PostPosted: Wed Apr 30, 2008 11:38 pm     Reply with quote

Out of curiosity, has anyone got a version up and running yet?
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