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

Usb Mass Storage + eeprom (or flash pic, or eeprom pic)

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



Joined: 20 Nov 2010
Posts: 44

View user's profile Send private message

Usb Mass Storage + eeprom (or flash pic, or eeprom pic)
PostPosted: Tue Aug 13, 2013 11:19 pm     Reply with quote

Please help me how to make a device that is in the OS defined as a regular USB flash drive, and then works with the external/internal eeprom memory or free space of the flash microcontroller.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed Aug 14, 2013 12:49 am     Reply with quote

Don't do either....

On the USB side, you need the bulk device (as in the scope example), with the descriptor type set to 8 (mass storage).
However you need to also be aware of the difficulties this imposes. Remember if Windows is talking to a mass storage device, it will generate a FAT file-system. Now this immediately means a directory, and file allocation table, so several KB used. Windows in recent releases, gives problems handling volumes smaller than about 160KB with any FAT system (FAT12). This was the size of the smallest floppy the system was built to handle. So this is the smallest size the 'drive' can be. You are not going to fit that into a small EEPROM, or the memory of the PIC.
The smallest it can handle with FAT16, is 4.1MB.

You need a lot more memory.

Best Wishes
fkl



Joined: 20 Nov 2010
Posts: 44

View user's profile Send private message

PostPosted: Thu Aug 15, 2013 3:51 am     Reply with quote

Ttelmah wrote:
Don't do either....

On the USB side, you need the bulk device (as in the scope example), with the descriptor type set to 8 (mass storage).
However you need to also be aware of the difficulties this imposes. Remember if Windows is talking to a mass storage device, it will generate a FAT file-system. Now this immediately means a directory, and file allocation table, so several KB used. Windows in recent releases, gives problems handling volumes smaller than about 160KB with any FAT system (FAT12). This was the size of the smallest floppy the system was built to handle. So this is the smallest size the 'drive' can be. You are not going to fit that into a small EEPROM, or the memory of the PIC.
The smallest it can handle with FAT16, is 4.1MB.

You need a lot more memory.

Best Wishes

I do not need a lot of memory will be enough and 255 bytes, most importantly usability.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Aug 15, 2013 4:02 am     Reply with quote

Great, but in which case it can't be handled as a 'mass storage'' device....

The point is that the Windows drivers make 'assumptions' about what is attached. One of the assumptions, is that a 'mass storage' device _can_ store a 'mass' of data.

You can handle it yourself as a bulk transfer device if you want (this is what the scope example does), or just talk to it as CDC.

Thinking more about it, I'd suggest using the Chip Card Interface Device Class. This is what cards for things like dongles, with a small amount of ROM/RAM use.

Best Wishes
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