• AVR Freaks

FTDI FT232 driver for MCHPUSB?

Author
okhan
New Member
  • Total Posts : 13
  • Reward points : 0
  • Joined: 2008/10/01 14:14:21
  • Location: 0
  • Status: offline
2008/10/20 16:56:49 (permalink)
0

FTDI FT232 driver for MCHPUSB?

Hello-

I need to customize the MCHPUSB Host driver running on a PIC24 to be able to send and receive data over the USB to and from the FTDI FT232 chip.

I have used a software called USBlyzer to analyze the packets that are being received by the windows xp driver from the chip.

when there is no data it receives the packet: 51 60

when there is data it receives the packet: 51 60 <byte data>

I have been successful in reading the first 2 bytes (51 and 60) on the PIC24 but the 3rd byte is always read as 0 even when data is supposedly being received. I did some research and it seems like the FTDI windows drivers does some software based initializations on the FT232 during enumeration that tells the chip how often it should be sampling its com port and put the data out on the USB EP. My guess is that the chip is not even outputting anything onto the USB since I do not have these parameters being initialized in my code. That is probably why I always read 0's as the 3rd byte.

Unfortunately, I have had no luck in trying to find any information on how to accomplish these initializations in a custom driver, and have had no reply from FTDI support for requests for information and/or their windows driver source code. Only thing I have found is a document from FTDI instructing how to customize these parameters in their .ini file which configures their dll. Has anyone out there done a custom driver for the FT232? I would be really thankful for any guidance since I am also pretty new to USB development.

Thank you.
#1

10 Replies Related Threads

    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2008/10/20 22:37:53 (permalink)
    0
    You are on a difficult task without the support from FTDI (and I guess they are not keen to support you because they have their own chips with USB host support).
     
    You may want to look at the source code of the FTDI Linux driver to learn more about the operation of the FTDI chip. A hardware USB analyzer may help as well.

      USB_Links and libusb
    #2
    Holligan
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/04/16 13:54:45
    • Location: Austria
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/16 13:59:14 (permalink)
    0
    Hi okhan
     
    I'm facing the same problem.
    A PIC24F as a host and the FT232 chip on a device board.
    My problem is that as a newbie I'm not able to establish any communication. The reply via explorer board 16 and uart2 is that the Client driver is not found. But I already set up a driver, what should I do?
     
    Can anybody help?
     
    Thanks.
    #3
    okhan
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2008/10/01 14:14:21
    • Location: 0
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/16 14:37:18 (permalink)
    0
    Hi Holligan-

    This is an issue that is probably not going to get solved any time soon (if ever).

    The problem is that the FT232 is not a CDC device. Instead, it uses a Custom USB Protocol that was developed by FTDI, which is why you need to install a driver that they provide on a CD whenever you plug in anything which uses a FT232 into your PC.

    So in short, the PIC (or any other MCU/PC not running an OS which the FT232 driver supports) cannot talk to the FT232.

    In order to do so you would need a PIC FT232 Host driver which is basically a port of their windows driver to the PIC. I contacted FTDI for support in doing this and at most all they would do is provide documentation on how the protocol works and the rest would have been up to me. Which would have been good enough, but they insisted that I sign a 5 year non disclosure agreement (which would have pretty much prevented me from sharing that information or even the code that I came up with, with anyone else). And that would have completely defeated the purpose of what I was trying to accomplish, not to mention the amount of effort and headache it would have taken to port their driver. So I did not pursue it any further.

    I was fortunate enough to be able to change my design to use another PIC24 instead of the FTDI chip on the client side.

    To do this, use the CDC USB Client Stack on the PIC24 that will be your client device and you can communicate with any serial device using the Rx and Tx pins. If you need RS232 levels instead of TTL levels then all you need to do is place an RS232 transceiver such as the MAX202 on the PIC24's Rx and Tx lines.

    Then on the Host PIC24 side all you need to do is use the CDC USB Host Stack.

    Hope that helped!
    #4
    Holligan
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/04/16 13:54:45
    • Location: Austria
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/16 22:17:21 (permalink)
    0
    Hi okhan!
     
    Thank you very much for your information.
     
    My problem is that we already use the FT232 chip in several hardware devices for the PC communication. We now want to "create" a stand alone application and the PIC24 was ment to be the host and connect all of our devices without the need of a PC.
     
    So I have to find out if its worth writing a PIC-FT host driver or not.
    #5
    okhan
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2008/10/01 14:14:21
    • Location: 0
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/17 08:24:24 (permalink)
    0
    Hi Holligan-

    Yes, we had the exact same problem. We have a lot of other devices which we used the FT232. But in the end it turned out to be cheaper and more time efficient for us to just rev the other devices to replace the FT232.

    1) FT232 is more expensive than a PIC24
    2) We would have to invest A LOT of time developing a PIC driver for FT232
    3) PIC24 firmware is free and the CDC Client Firmware operates very similar to how the FT232 works. When you plug it into a PC its recognized as a virtual COM port. So we would not have to modify any PC based software which talked to the devices.

    So it didn't really make sense for us to pursue the FT232 path.

    If you do decide to go ahead with trying to develop your own FT232 driver. I would suggest that you get started sooner rather than later. I believe that there is some sort of approval process that FTDI goes through to determine if they are willing to approve the NDA.
    #6
    RISC
    Super Member
    • Total Posts : 6000
    • Reward points : 0
    • Status: online
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/18 15:13:06 (permalink)
    0
    Hi,

    I just found out recently that the company Firmware Factory Ltd ( http://www.hexwax.com/products.aspx ) is selling PICs which do bridge functions like UART <--> USB (as well as SPI bridge, I2C bridge) based on HID class ;=)
    These products are actually simple PICs sold with pre-programmed firmware

    I think this is a brilliant idea to have a USB <---> UART bridge WITHOUT any driver installation ;=)
    This makes it easy to sell and to support by end customers.

    regards
    #7
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/19 16:56:51 (permalink)
    0
    Actually PICkit 2 has this kind of capability. It has the Serial communication function, basically an HID--> Serial gateway. It can also programming I2C and SPI EEPROM, so kind of HID-->I2C/SPI gateway. You probably need to change some firmware to be real gateways but the infrastructure is there.

      USB_Links and libusb
    #8
    Holligan
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/04/16 13:54:45
    • Location: Austria
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/20 00:31:28 (permalink)
    0
    Sounds great, but my problem is that we do have thousands of devices in field and we are not able to change them all!!
    I now want to build up a new base station that works with all other "slaves" without any change. So I have to find a solution for communicating with the FT232 chips.
    #9
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/20 01:48:27 (permalink)
    0
    I think it is hard work but is possible. A USB hardware analyzer will help a lot in this case as you may need to reverse-engineering some of the behavior.
     
    You may want to start with USB Host generic driver demo and the CDC demo. You also can try to get some information from FTDI or use the open source driver and libftdi.
    http://www.ftdichip.com/Drivers/3rdPartyDrivers.htm
    http://www.intra2net.com/en/developer/libftdi/

      USB_Links and libusb
    #10
    Holligan
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/04/16 13:54:45
    • Location: Austria
    • Status: offline
    RE: FTDI FT232 driver for MCHPUSB? 2009/04/20 22:32:43 (permalink)
    0
    Thanks!
    I now have a lot more information for preparing a discussion with my boss!
    Hopefully he will let me start developing!
    post edited by Holligan - 2009/04/20 22:34:41
    #11
    Jump to:
    © 2021 APG vNext Commercial Version 4.5