Need some advices on using an FTDI module to read USB data

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
iZacki
 
Posts: 2
Joined: Wed Jun 17, 2015 9:27 pm

Need some advices on using an FTDI module to read USB data

Post by iZacki »

Hi all,

I'm currently in a project that involves the creation of a module that can "snif" usb data passing through with a microcontroller (an Arduino in my case), and store it. To do that, I'm gonna use a usb hub. Since the usb protocol "broadcasts" the data to all the devices in a hub, I'll simply have to connect my sniffer to another port of the hub and catch the data.

Now, the tricky part is, how to read that data without having to code the usb protocol in the Arduino. It's where I need your advices. I've seen a lot of FTDI modules that can get a USB connection and read it with UART 232 protocol. Now, what I want to know is, first, is this possible? Can I connect an FTDI USB/Serial module to the usb hub, and write an Arduino program to read the converted data using the Arduino serial input port? The big problem I see with this solution is that the FTDI chip should never try to talk to the host since it must be invisible. Since the USB protocol don't have an RX and a TX dedicated wire, I cannot simply disconnect a wire to prevent that. Next problem, the usb may go faster than the serial connection, so, I need an FTDI module that can handle a FIFO buffer. Since I cannot talk to the host, I have only one chance to read the USB data. What FTDI module can help me doing this? I need to handle USB 2.0. Low and full speed support is important, but high speed isn't.

I don't know if I'm clear enough, but I can answer your questions!

Thank you!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Need some advices on using an FTDI module to read USB da

Post by adafruit_support_mike »

You'd probably want something that isn't a USB device at all.

Any FTDI chip will automatically go through the whole registration and acknowledgement process with the hub, which you don't want. It sounds like you just want to copy the bits as they go past, and maybe decode the packets in software.

Take a look at the LUFA project for an implementation of software USB: http://www.fourwalledcubicle.com/LUFA.php

User avatar
iZacki
 
Posts: 2
Joined: Wed Jun 17, 2015 9:27 pm

Re: Need some advices on using an FTDI module to read USB da

Post by iZacki »

Thanks a lot for your help, I'll contact the LUPA project owner.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”