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

communicating with USB thumbdrive

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



Joined: 26 Sep 2003
Posts: 218
Location: Northern Indiana

View user's profile Send private message

communicating with USB thumbdrive
PostPosted: Fri Jan 22, 2016 7:41 am     Reply with quote

I would like to add a USB port to a project for thumbdrive support.
I really liked that the CCS functions for USB CDC were so much easier to implement than the Microchip stuff and expect that the USB Host implementation would also be easier than Microchip, but I can't seem to find any functions or examples relating to USB Host, communicating with a thumbdrive, etc.

It looks like one of the proto kits would do that. If I have to I will just buy one of those, but it would have to use existing functions and it seems like there must be some example code somewhere, but I'm just not seeing it.
I always seem to be tripping over these things when I'm not looking for them, but when I finally need them they hide from me!
Can anyone clue me in on where to look?

Thanks,
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Fri Jan 22, 2016 8:25 am     Reply with quote

Honestly the easiest way is to add the FTDI VDRIVE (Vdrive2 or 3 now).

The Microchip USB host code can be adapted to compile under CCS, but it is bulky, fairly unreliable, and difficult to get working right. CCS themselves have never done a port of this, and having used the Microchip code, I can understand why. The chips just do not handle being a USB host at all well. Even using the Microchip code directly, I found individual slave devices gave problems. The actual stack is just not that good.

Conversely you can have a Vdrive based unit up and running in a couple of hours, and it uses only a tiny amount of ROM. Using the module, it gives you the connector as well. Using the hardware SPI interface, it is as fast in use as the hardware USB (on chips with DMA, this can be used). Alternatively a UART can also be used.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 22, 2016 8:28 am     Reply with quote

There are two ways to add a flashdrive( thumb drive)
1) Use a PIC with OTG capability. It can be configured as a 'host'. Can't help further, others may have done that...

2) Use a Vinculum module(Vdrive?). This is a complete unit.looks like a serial port to the PIC and can talk to any flashdrive. I did a 'datalogger' using one 5-6 years ago for an energy study system. While it was expensive, it was simple to interface and get 'up and running'. Yes, you can buy the chip, connectors, xtal, etc. but R&D $$ ain't cheap. Now if the data is to be used in a PC one 'trick' is to format the data in 'dotCSV' format. If you do, then that data can be automatically loaded into an Excel spreadsheet!

Jay
pmuldoon



Joined: 26 Sep 2003
Posts: 218
Location: Northern Indiana

View user's profile Send private message

PostPosted: Fri Jan 22, 2016 2:30 pm     Reply with quote

Thanks, that helps a lot.
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Fri Jan 22, 2016 8:13 pm     Reply with quote

Here is one example using one of those VDRIVE with a PIC processor (down near the bottom of the pdf file) http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_VDRIVE2.pdf Looks like Digikey (and others) carry them in the $20 price range (I was curious since this was another project I was thinking about - too many projects!)

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
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