+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Member level 5
    Points: 1,270, Level: 8

    Join Date
    Jun 2012
    Posts
    86
    Helped
    0 / 0
    Points
    1,270
    Level
    8

    PIC 18f620 interfacing with usb

    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

    •   AltAdvertisment

        
       

  2. #2
    Administrator
    Points: 69,285, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2355 / 2355
    Points
    69,285
    Level
    64
    Blog Entries
    4

    Re: PIC 18f620 interfacing with usb

    Quote Originally Posted by td micro View Post
    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 ?
    The short answer is: you cannot interface a USB Device/Slave Class directly to a microcontroller which does not offer a USB Host Class interface, at least not without additional interface controller logic.

    There are third party devices available to accomplish the task:

    Vinculum Embedded USB 2.0 Host Controller

    VNC2 - Vinculum-II Programmable USB 2.0 Host

    MAX3421E - USB Peripheral/Host Controller with SPI Interface

    However, in the long run you maybe better off selecting a microcontroller which offers a USB Host Class Interface, such as some of the PIC24s, PIC32s or ARM Cortex-Mx series.

    You might also consider writing your data to a flash card, which can be interfaced using the SPI interface already available on the PIC18 utilized in your design. The flash card can then be accessed by a PC with a flash card USB Reader/Writer interface.
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson



  3. #3
    Member level 5
    Points: 1,270, Level: 8

    Join Date
    Jun 2012
    Posts
    86
    Helped
    0 / 0
    Points
    1,270
    Level
    8

    Re: PIC 18f620 interfacing with usb

    thank you for reply
    i will buy one third party ic



  4. #4
    Administrator
    Points: 69,285, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2355 / 2355
    Points
    69,285
    Level
    64
    Blog Entries
    4

    Re: PIC 18f620 interfacing with usb

    FTDI does offer development modules, like the VINCULUM-II DEV 2 PORT 32DIP, which you could later use in other projects.

    VNC2-32Q Development Module Datasheet

    The V2DIP2 supports USB flashdrives and their associated FAT file system.

    There are other third party development modules available as well.
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson



  5. #5
    Member level 5
    Points: 1,270, Level: 8

    Join Date
    Jun 2012
    Posts
    86
    Helped
    0 / 0
    Points
    1,270
    Level
    8

    Re: PIC 18f620 interfacing with usb

    thank you ...
    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 ic for interfacing controller and usb female connector?



  6. #6
    Administrator
    Points: 69,285, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2355 / 2355
    Points
    69,285
    Level
    64
    Blog Entries
    4

    Re: PIC 18f620 interfacing with usb

    No, the CP2102 is a USB Device Class Controller, you need a USB Host Class Controller.

    Specifically, the CP2102 implements a USB Device CDC Class interface, a virtual serial COM port. The key terms are Device and Host, the CP2102, a USB Device, requires a USB Host to interface, such as a PC.

    A USB flashdrive is a USB Device Class Interface, therefore you need a USB Host Class Interface to which the USB flashdrive connects.
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  7. #7
    Member level 5
    Points: 1,270, Level: 8

    Join Date
    Jun 2012
    Posts
    86
    Helped
    0 / 0
    Points
    1,270
    Level
    8

    Re: PIC 18f620 interfacing with usb

    thank you verymuch...
    this was new to me.
    i will buy one USB Host Class Interface.

    thank you



  8. #8
    Administrator
    Points: 69,285, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2355 / 2355
    Points
    69,285
    Level
    64
    Blog Entries
    4

    Re: PIC 18f620 interfacing with usb

    On another note:

    You could use the CP2102 or FT232R to effectively allow your design to become a USB Device which could then download data directly to the PC without any need of a transfer media like the USB flashdrive.

    Although you still might be better off replacing the PIC18F4620 with a PIC18 which offers a USB Device Class Interface, it maybe more cost effective.

    - - - Updated - - -

    Pickup a copy of Jan Axelson's USB Complete: The Developer's Guide, 5th Edition

    Actually, if you can find a used copy of the fourth edition it would certainly be helpful.

    USB Complete Fourth Edition : The Developer's Guide
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson



  9. #9
    Super Moderator
    Points: 61,770, Level: 60
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,597
    Helped
    2921 / 2921
    Points
    61,770
    Level
    60

    Re: PIC 18f620 interfacing with usb

    Hi,

    instead of USB host and pendrive..

    maybe you could use an SDcard. This is easy to connect with SPI bus to almost any microcontroller.
    But your microcontroller needs to control the FAT.

    Klaus



  10. #10
    Member level 5
    Points: 1,270, Level: 8

    Join Date
    Jun 2012
    Posts
    86
    Helped
    0 / 0
    Points
    1,270
    Level
    8

    Re: PIC 18f620 interfacing with usb

    okay.
    thank you all



  11. #11
    Administrator
    Points: 69,285, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2355 / 2355
    Points
    69,285
    Level
    64
    Blog Entries
    4

    Re: PIC 18f620 interfacing with usb

    I also previously suggested that option, reply #2:

    https://www.edaboard.com/thread335925.html#post1432937

    You might also consider writing your data to a flash card, which can be interfaced using the SPI interface already available on the PIC18 utilized in your design. The flash card can then be accessed by a PC with a flash card USB Reader/Writer interface.
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson



    •   AltAdvertisment

        
       

  12. #12
    Super Moderator
    Points: 61,770, Level: 60
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,597
    Helped
    2921 / 2921
    Points
    61,770
    Level
    60

    Re: PIC 18f620 interfacing with usb

    @bigdogguru

    sorry, i missed this.


    Klaus



  13. #13
    Administrator
    Points: 69,285, Level: 64
    Achievements:
    Created Album pictures Created Blog entry 7 years registered
    bigdogguru's Avatar
    Join Date
    Mar 2010
    Location
    Southwest, USA
    Posts
    9,832
    Helped
    2355 / 2355
    Points
    69,285
    Level
    64
    Blog Entries
    4

    Re: PIC 18f620 interfacing with usb

    @KlausST

    No problem.

    @td micro

    I just came across FTDI updated version of the VDrive, the VDrive3, which is preprogrammed with the firmware for reading/writing of USB flash memory devices:

    FTDI VDRIVE3

    FTDI VDRIVE3 Datasheet

    Comes in a nice enclosure, provide UART or SPI to the MCU and is reasonably priced at $22 USD.
    The Edge... there is no honest way to explain it, because the only people who really know where it is are the ones who have gone over.
    -- Hunter S. Thompson



--[[ ]]--