USB Host - Device Detect

Having trouble tracking down an issue with USB host. When I connect/disconnect a device to the Domino I ofcourse trap the event with the following:

        USBHostController.DeviceConnectedEvent += OnDeviceConnected;
        USBHostController.DeviceDisconnectedEvent += OnDeviceDisconnected;

The problem is that about 10% of the time the event does not fire when the device is connected. I thought it might be the device, but it appears that others exhibit the same behavior. Further, if I connect the device to a PC I do not see any “missed” connections.

What might cause the USBizi to “miss” the interrupt about 10% of the time?

Device is powered with its own PSU. Domino is powered with regulated 5V with 3A capacity. I put some large caps in there just in case a voltage drop was the issue, but that has not helped.

Let me know if you have any suggestions where to look.

Thanks -AP

How about showing us your code?
Might be that something in your code is the cause.

Maybe plugging in the device causing power surge? Can you add power pack to domino and try?

The code was straight from the EBook. I even isolated it futher by just doing the minimum declarations to just look at the DeviceConnectedEvent.

I’ll look at a possible surge by attaching a powerpack to the Domino rather than using the 5VIN, but I’m not sure I see how a surge would be coming from the 5V into the domino when I connect a USB device. I would have expected the opposite.

Make a new project that ONLY has three events and see the results:

Ok, so I somehow missed the DeviceBadConnectionEvent event in the documentation. Now that I implemented it I see it is triggering a bad connection event about 10% of the time.

So, the next question is how can I dig into the reason the bad connection event is fired and how can I forced a reconnect without having to physically remove and replace the plug or toggle the power to the USB device?

This happens with other USB devices too besides this one and it does not appear to happen when connecting them to an ordinary PC.


Usually it is because not enough power is provided

To the Domino or the Device? I have a scope on the USB power and the connection process has no effect. Is it a power issue to the USBizi chip? Where would I be able to see the power issue so I can address it?

no it is not FEZ, FEZ is fine … the device is not starting properly. You can try a large capacitor on the 5V line right on USB host connector

Well, I’m gonna cheat by trapping a bad connection event and triggering a reset circuit on the USB device. I tried large caps on the 5V power, a PSU on the 7-12VIN, different cables, different devices, but it continues to have intermittant issues connecting to USB devices.

On to other issues…more posts coming. woo hoo!

Is there a way to reset the USB host controller on the Domino in code like you can on a windows box?

Ideally you would have a USB power control chip for better control and protection.

But you said you are reseting the power somehow?

The device has a power reset switch I am triggering with fez. Its just that it takes about 1.5 second and I was hoping to make that faster.

I’ll consider a management chip for production units. Any recommendations?

Something like this

You will not get events on USB Host immediately. Until the device is recognized, enumerated…
1.5 sec sounds ok.