0

I am testing a WinCE device that loses all USB communication infrequently. I need to detect when the USB fails on this device. When it fails, the power is intact at the port, just no data at all on D+ and D- (I verified this with an oscilloscope). This host device is basically a black box to me so I can't do anything to it but check it's state.

My proposed solution: Use an arduino of some type (preferably an UNO since I have one already) programmed to detect USB activity to let me know when USB is failing on the host device I am testing.

Is this possible? The arduino seems like a good solution for me because I assume it is a USB client, which I need in this scenario. Any example or pointing me in the right direction would be of great help. Thanks!

asked Oct 14, 2015 at 16:10
3
  • 1
    If you choose to use an Uno you probably need to reprogram the ATMega16u2 on the board, that does the usb-to-serial. I think it would be easier to have a arduino in which the main chip support USB, like the Leonardo or Micro. But I haven't done anything with USB myself. Commented Oct 14, 2015 at 17:59
  • If you modify the firmware of the USB interface chip, implement software USB, or use a native-USB board like the Arduino Leonardo, it would be fairly trivial to run a time-out timer on USB traffic and thus see if the normally periodic polling of this slave ceases. Commented Oct 16, 2015 at 2:21
  • Did you manage to figure this out? If so can you please share the code? Commented May 5, 2024 at 21:37

1 Answer 1

0

If all you are interested in is the voltages on the D+ and D- lines you could wire those direct into two ADC inputs on the Arduino and wire +5V and GND into the +5V and GND pin. The Arduino can then sample the voltages and compare them to valid or invalid ranges.

answered Oct 14, 2015 at 22:51
2
  • This is a great idea. So glad I asked; I can't believe it didn't even cross my mind. Commented Oct 15, 2015 at 16:39
  • 1
    No, that's really not going to work well. The USB signalling is outside the bandwidth of the arduino ADC. You need to look for transitions, not levels. Commented Oct 16, 2015 at 2:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.