Search code examples
microcontrollerusb-driveusbserialusb-flash-drive

How can I detect if there is data activity on a USB flash drive with my own circuit?


I am currently working on a project for my university course. I am design a device which will be an intermediate interface between the computer and a USB flash drive, i.e. data go from computer->my device->USB drive.

One of the functions I want on this device is to be able to detect if there is any data activity going on, and send this information to the microcontroller. I don't need to know anything about the data itself, just whether there is data being transferred.

I've done some research online about how USB works, but I can't seem to find a good way of doing this. I have spoken to a tutor at uni. Apparently this is "very easy" to do, but I don't really know how. Can anyone suggest some ideas? Thanks very much.


Solution

  • You are trying to make a protocol analyzer like catc http://teledynelecroy.com/protocolanalyzer/protocolstandard.aspx?standardid=4 These is a device which is like man in middle for any network.

    You would need your device to act as USB host(master) and USB device(slave) at same time. Also while copying data from one port to another you need to make a data copy for analysis. USB devices have critical timing requirements and operate at high data rate. So you might need good amount of processing power in your device. Also this makes such analyzers expensive.

    If there is no requirement for analyzing USB protocol, you can have device that will analyze slower buses like uart,spi I2c etc.You can check hobby manufacturers like sparkfun for such tracing devices. Best luck with your endeavor