View previous topic :: View next topic |
Author |
Message |
td
Joined: 16 Apr 2015 Posts: 21 Location: India
|
USB interfacing with pic18f4620 |
Posted: Thu Apr 16, 2015 4:15 am |
|
|
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: 19513
|
|
Posted: Thu Apr 16, 2015 4:54 am |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Apr 16, 2015 5:01 am |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Apr 16, 2015 5:02 am |
|
|
gee. Mr. T. Great minds think alike ! And type at the same time !!
Jay |
|
|
td
Joined: 16 Apr 2015 Posts: 21 Location: India
|
|
Posted: Thu Apr 16, 2015 5:10 am |
|
|
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
|
|
Posted: Thu Apr 16, 2015 5:11 am |
|
|
sorry.. i m very slow.. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Apr 16, 2015 10:54 am |
|
|
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!...
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).... |
|
|
|