|
|
View previous topic :: View next topic |
Author |
Message |
fkl
Joined: 20 Nov 2010 Posts: 44
|
Usb Mass Storage + eeprom (or flash pic, or eeprom pic) |
Posted: Tue Aug 13, 2013 11:19 pm |
|
|
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
|
|
Posted: Wed Aug 14, 2013 12:49 am |
|
|
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
|
|
Posted: Thu Aug 15, 2013 3:51 am |
|
|
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
|
|
Posted: Thu Aug 15, 2013 4:02 am |
|
|
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 |
|
|
|
|
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
|