How to talk to FT2232H chip (set to FIFO mode) via USB Host on FEZ Cobra?

Hi,

I have a board with an FT2232H chip set up in parallel (FIFO) mode. I want to send commands to this chip using the USB host capability of FEZ Cobra but the GHI USB Host class only recognizes serial FTDI chips.

I want to know if I can use FTD2XX_NET.dll from FTDI (will work with .NETMF) or do I have to use the Raw USB device class?

Thanks!

Welcome to the forum.

I want to know if I can use FTD2XX_NET.dll from FTDI (will work with .NETMF)

No, full .NET DLLs are not compatible with the Micro Framework version of .NET.

I am not familiar with the FT2232H chipset, so I can answer your second question.

Hi Frizb33fever, welcome to the forums !

FT2232H is a serial chip, even though you’re using it in a particular way; I assume you have tried to get it working and it hasn’t worked? When it comes to this kind of issue, not knowing what endpoints are available to communicate to, I always point to the USB Discovery helper, http://www.tinyclr.com/codeshare/entry/115 that will help show what endpoints you can communicate to. Give that a try and report back what is present.

As far as I know, the DLL that FTDI provide is a full .Net component and will not work on the netmf. You say “(will work with .NETMF)” do you know that for sure, or are you just guessing (or even asking it as a question)? It is likely that the only fallback will be raw USB, sorry to say.

Thanks, Brett and Mike.

I meant to write “will it work with .NETMF”, so it was a question because I don’t know whether it does or not.

I’ve only used the example code in Beginner’s Guide to .NETMF to print to the output window the device ID, device interface, and device type when a USB client is connected to the USB host. It gave me a type 0 (unknown) when I connect the FT2232H chip to it.

I ran USB Discovery Helper and here’s what it output when I plugged in the board with the FT2232H chip:

[Device, Port 0]
Type: Unknown
ProductID: 24592
VendorID: 1027
=== Interface ===
Class: Vendor Specific
SubClass: 255
Number: 0
Protocol: 255
Type: 4
– Endpoint –
Attributes: 2
Address: 129
Type: 5
Interval: 0

– Endpoint –
Attributes: 2
Address: 2
Type: 5
Interval: 0

=== Interface ===
Class: Vendor Specific
SubClass: 255
Number: 1
Protocol: 255
Type: 4
– Endpoint –
Attributes: 2
Address: 131
Type: 5
Interval: 0

– Endpoint –
Attributes: 2
Address: 4
Type: 5
Interval: 0

[Device, Port 0]
Type: Unknown
ProductID: 24592
VendorID: 1027
=== Interface ===
Class: Vendor Specific
SubClass: 255
Number: 0
Protocol: 255
Type: 4
– Endpoint –
Attributes: 2
Address: 129
Type: 5
Interval: 0

– Endpoint –
Attributes: 2
Address: 2
Type: 5
Interval: 0

=== Interface ===
Class: Vendor Specific
SubClass: 255
Number: 1
Protocol: 255
Type: 4
– Endpoint –
Attributes: 2
Address: 131
Type: 5
Interval: 0

– Endpoint –
Attributes: 2
Address: 4
Type: 5
Interval: 0

=======================================================================

FYI, FT2232H is a dual-port USB to UART/FIFO chip.

Vendor Specific… says it all, time to break out the RAW comms I’m afraid !

FTDI chips are usually simple. If you have a USB analyzer and understand USB, you should be able to make this work.

Yes, I plan to use USB Raw Device class for this. I have a LabView GUI that sends 4 commands to my board (which has the FT2232H chip) via USB. I’m trying to replicate that using the FEZ Cobra. I installed USBlyzer and watched the USB stream when I used the LabView GUI to send the commands. It saw 4 commands, 8 bytes each, separated by 8-byte buffers. I have no intention of reading from the FT2232H chip (that’s not my short-term goal, at least).

I don’t “understand” USB, but from poking around the internet, I came across some example codes which I tried to decipher. In each of them, after using OpenPipe to open up a communication channel to the USB client, SendSetupTransfer was called before anything else was done. I read the USB setup packet but I still don’t know how to set it up (and I don’t know if I have to set it up). Would any of the bytes in the 4 commands I want to send to the FT2232H chip be sent through the SendSetupTransfer command or would it be through TransferData?

Can anyone tell me what I should write in the SendSetupTransfer arguments if I need to call it? For “bmRequestType”, bit 7 is probably 0 (host to device). Bits 6 and 5 are probably Class or Vendor, and bits 4-0 are most likely Endpoint. But I’m not certain. I also don’t know what the “bRequest” would be! Help?