|
|
View previous topic :: View next topic |
Author |
Message |
edi
Joined: 22 Dec 2003 Posts: 82
|
USB I/F |
Posted: Mon Dec 17, 2012 8:47 am |
|
|
I have application that log information and store it on the PIC's EEPROM.
From time to time I need to transfer the stored logs via USB to a PC.
Can someone recommend on the proper USB mode for it?
Is it CDC, HID or Storage?
What are the advantage/disadvantage? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19505
|
|
Posted: Mon Dec 17, 2012 9:39 am |
|
|
Depends on how often the data is generated, how much data is generated, and what else is happening on the bus.
If the data amounts are small, then probably CDC. If larger, then storage.
Best Wishes |
|
|
edi
Joined: 22 Dec 2003 Posts: 82
|
|
Posted: Mon Dec 17, 2012 1:07 pm |
|
|
Is it possible to use Storage mode using the PIC internal EEPROM memory or SD card/other storage is needed?
Can you please refer to sample or other links that might help. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Mon Dec 17, 2012 3:12 pm |
|
|
Normally 'data loggers' require more memory than a typical PIC has in EEPROM and there are 3 usual options.
1) FRAM
2)MMC/SD
3)USB Flash drives
What you choose all depends upon application,cost and programmers skill level.
FRAM is somewhat costly and I've never used it...
MMC/SD is full of minor bugs (like mismatched VDD levels, driver limits), I will NOT use them. There is no real standard for the cards and size matters!
USB flash drives use the 'Vinculum' module (about $30). Pluses include unlimited storage capability, simple interface, simple programming(driver), any PC can easily read the data (if stored in CSV format).
You have to first know how much data(in bytes) you need to store.Be generous as you'll always need more.
Do a search of this forum for mmc/sd and you'll see dozens of topics,tons of 'issues' and a LOT of frustration when trying to use them.
Ask yourself what is your time worth! $30 for a 100% working module is less than a 1/3hr of my time, so how soon do you need your code 'up and running'.
hth
jay |
|
|
edi
Joined: 22 Dec 2003 Posts: 82
|
|
Posted: Tue Dec 18, 2012 12:09 am |
|
|
Thanks.
What about HID - what is the recommended case to use it? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19505
|
|
Posted: Tue Dec 18, 2012 2:12 am |
|
|
HID, is a 'class' of interfaces, not a single interface type. Stands for 'human interface device', and covers things like keyboards, mice, joysticks, etc. etc.. There is a sub part of this covering things like thermometers, which can be used for a data logger, but again we are back to the original question I asked, how much data, how often updated?.
Examples:
Simple data 'logger' returning a dozen values, once a second. Honestly easiest, CDC. Think about it this is exactly what a device like a GPS returns, and here there is a serial standard used, with a little bracket encapsulated packet, comma separated numbers, easy to read on a serial interface.
Then a data logger that people want to look at/interrogate. Actually probably easier to implement over ethernet. Actually generate a web page with the device. Could be done as a CDC device using TCP as an encapsulation layer on top.
Then a device that gives a movement reaction to some external stimulus. Possibly implement as an HID joystick device.
Then a logger where people want to be able to look at a lot of data. Implies you need the storage for this (SD card etc.), and probably bulk transfer storage device class. However if the amount of data is only a few kB, this could just be a RAM buffer in a larger PIC.
So, the amounts of data, and how you want to interface to it, changes what solution is best/easiest to use. This needs to be your starting point.
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
|