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 interfacing with pic18f4620

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



Joined: 16 Apr 2015
Posts: 21
Location: India

View user's profile Send private message

USB interfacing with pic18f4620
PostPosted: Thu Apr 16, 2015 4:15 am     Reply with quote

Hi,
in our project, we are using 18f4620 controller.some information is saved in external eprom connected to this controller. i want to connect one pendrive (usb) to my board for collecting those data saved. (later, pendrive is connected to pc for display)
for that i have to interface one usb female connector with my pic controller.
how can i interface usb with 18f4620 ?
please help
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Thu Apr 16, 2015 4:54 am     Reply with quote

You need to add a device like a FTDI Vinculum.
This accepts simple serial commands from the PIC, and can control the USB pendrive.
The simplest to use for you, would be the VDRIVE2 (or 3) module. Do a search for this.

USB is not a simple interface for the master device. The master has to handle the USB 'stack', and control the bus. This is _possible_ on PIC's that support USB 'OTG' (not on the other USB PIC's), but involves large and complex code. The Vinculum does all this work for you.
temtronic



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

View user's profile Send private message

PostPosted: Thu Apr 16, 2015 5:01 am     Reply with quote

The 'normal' way is to purchase an FTDI Vinculum based interface module. This allows the PIC via its harware UART to access the pendrive( a USB based memory module). Fairly simple to code, I did a 'data logger' some years ago using this method, still running as I type. Hint: If you store the data in dotCSV format, then eXcel will automatically open the datafile in a spreadsheet !
There may be other modules available now, the Vinculum was what was 'current' years ago.

Jay
temtronic



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

View user's profile Send private message

PostPosted: Thu Apr 16, 2015 5:02 am     Reply with quote

gee. Mr. T. Great minds think alike ! And type at the same time !!

Jay
td



Joined: 16 Apr 2015
Posts: 21
Location: India

View user's profile Send private message

PostPosted: Thu Apr 16, 2015 5:10 am     Reply with quote

Thank you. thank you for reply
i will try to buy this module. i found USB to Serial TTL Converter with CP2102 while browsing. but it has male connector.so i cant connect pendrive with this.

can i use cp2102 for that?
td



Joined: 16 Apr 2015
Posts: 21
Location: India

View user's profile Send private message

PostPosted: Thu Apr 16, 2015 5:11 am     Reply with quote

sorry.. i m very slow.. Sad
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Thu Apr 16, 2015 10:54 am     Reply with quote

Just a 'beware' to anyone else thinking the same way, USB to serial converter modules are _slave_ devices.

The whole problem is needing a master device. The CP2102, is a slave device, so 'no'.

For master applications, Temtronic and I 'think alike', and I would always say the easiest way to do this is one of the Vinculum modules.

We even posted in stereo!... Smile

The Vdrive module, is a doddle. It clips into your front panel, has the USB connector, and just needs power, and a serial connection to the PIC. It can use SPI, or TTL serial (jumper on the module configures which). There is no easier/cheaper solution (you can go cheaper using the chip, but unless you are building large numbers, by the time you have added the connector, clock etc., the price soon reaches that of the module)....
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