Go Down

Topic: Native USB port, keyboard, how to toggle VBOF (5V native USB) at PB10 UOTGVBOF (Read 3 times) previous topic - next topic


The proper thing to do is to write code which detects and resets the fault condition but I don't have the right sort of USB cable so can't help.

@stimmer: thank you for the reply.

By "fault condition" you probably mean "there is no 5V at the native USB port". How can this be sensed? Or, at which pin does one have to look in order to find out?

May be by "fault condition" you mean that the device at the native USB port and the power supply are providing 5V to the native USB port. Again, how and where could this be sensed?

Or, by "fault condition" you mean, that the 5V from the native USB are shorted at the other end (where the USB cable leads to, e.g. a faulty keyboard or mouse). Once more, how could this be detected by a program?

Greetings, Conrad


It's the third meaning, detecting a possible short. Also I think it's one of the ways the USB hardware detects a device change.

Anyway I now have a cable and have tried looking at the code. Fortunately it looks like everything needed for correct VBOF control is already in the hardware and software - the problem is that the Due circuit (incorrectly in my opinion) expects the VBOF signal to be active high, but the software is written for it to be active low.

I have been trying the following workaround: in loop(), immediately after the line usb.Task();  add the line uhd_set_vbof_active_high();
This seems to work most of the time but sometimes the USB device doesn't work properly straight away - try pressing reset, or disconnecting the device and reconnecting.
Can you try this and tell me if it works for you?

Go Up