cancel
Showing results for 
Search instead for 
Did you mean: 

How do I know if the USB port (host mode) is working?

StephanMair
Senior
Posted on May 09, 2014 at 12:58

I'm using the F105 series Stm32, and if my grab of the USB protocol being correct, the USB works on polling mechanism which means when idle, there should be regular frame of data on the DM/DP.

The thing is, when I probed both DM/DP, I had no reading on my oscilloscope other than seemingly random, below 0.5V very wide pulses, which I'm pretty sure is noise since A, it's well below 3.3v and B, it looks nothing like NRZI wave forms.

I'm fully aware that I could be wrong in A, for saving power's sake, there may not ever be any ''polling frame'' (quoted because such term may not be legit) UNLESS a device is plugged in AND properly enumerated, which I have no way to find out since I don't even know whether my USB port can detect devices that's been plugged in. And B, my entire understanding of the polling mechanism maybe wrong.

I remembered quite clearly what the polling frame was like when a few months ago I was probing a computer's USB port, and I'm fairly sure no device was attached, or I wouldn't be able to probe the USB port.

Any ideas? Can anyone please help me?

To be more specific, the

HCD_IsDeviceConnected(pdev)

always returns zero, which means it can't detect my HID device, which has been tested on various comps to be fine.
3 REPLIES 3
StephanMair
Senior
Posted on May 09, 2014 at 13:01

Another thing, I have my hardware connection done by the book, that is, I did what the official datasheet told me to, no pull-up/down resistors. Not mentioned in the manual and it says all PU/PDs were built-in.

tsuneo
Senior
Posted on May 10, 2014 at 21:35

> I remembered quite clearly what the polling frame was like when a few months ago I was probing a computer's USB port, and I'm fairly sure no device was attached, or I wouldn't be able to probe the USB port.

To know device attach, host port detects voltage change at D+ (or D-) line, more than 2.0V (VIH), at least for 2.5us (TDCNN). Noise at hooking a probe may mislead the host port as device attach.

>  when I probed both DM/DP, ...  it's well below 3.3v

Your HID device should pull up D+ (or D-) line, greater than 2.0V (VIH).

If you wouldn't see this voltage at D+/D- line, the HID device shouldn't pull up the line.

But you are sure the HID device works for other hosts.

a) Do you supply 5V to the VBUS (5V) pin of the USB host connector?

The HID device may attach the pull-up, just when it sees 5V at VBUS pin - so that it is compliant to the USB spec.

b) Does the 5V supply have enough current capacity to drive the HID device?

Tsuneo

StephanMair
Senior
Posted on May 13, 2014 at 04:55

First, thank you for your kind reply.

I never though about the probe tricking the USB host into thinking a device was connected.

To answer your questions:

a): Yes, I'm using an STMP214 to supply 5V power, I measured it, it's a stable 5V.

b): absolutely. I can guarantee it's a stable 5V @ 500ma Max, which is in accordance with USB specs.