For my first electronics project, I decided to build an adapter to use a modern USB controller on a Gamecube console.
I got everything working using the USB programming port for development/power supply and using the USBHost library.
However, my ultimate goal is to only use the GC cable as a power source to the adapter, to carry it around easily.
The Gamecube cable contains 5 wires: 3.3v data line, 3.3v power, 3.3v GND, 5v power (for the rumble functionality) and 5v GND.
I first tried to plug the 3.3v power and GND wires from the GC cable into the 3.3v and GND pins of the Due. Debugging had to be done by talking to a logic analyzer since I did not have the USB programming port to print to Serial
. Here's what happened:
- Due boots up
- Controller (USB native port) does not seem to be detected
- Controller (USB native port) does not seem to be detected
- the
loop()
function seems to crash when invokingusb.Task()
orusb.getUsbTaskState()
- plugging in a USB mouse, the LED in the mouse wheel did not light up
After reading that VBUS is supposed to provide 5v to the guest device, I tried using the 5v power/GND wires from the GC cable instead of the 3.3v. Here's what happened:
- as before, Due boots up
- as before, controller (USB native port) does not seem to be detected
- unlike before, the
loop()
function DID NOT seem to crash when invokingusb.Task()
orusb.getUsbTaskState()
- unlike before, the LED in the mouse wheel DID light up
- with mouse plugged in, USBHost's
usb.getUsbTaskState()
returnsUSB_STATE_RUNNING
(yay!) and libsam'sUHD_GetVBUSState()
returnsUHD_STATE_CONNECTED
(yay!) - with controller plugged in however, USBHost's
usb.getUsbTaskState()
returnsUSB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE
(boo!) and libsam'sUHD_GetVBUSState()
returnsUHD_STATE_DISCONNECTED
(boo!)
I attached some code to reproduce the issue.
-
It appears that I can power the board, VBUS and the mouse is even working fine with the 5v coming from the Gamecube cable. Why isn't the controller working/detected by
UHD_GetVBUSState()
? What can I try next? -
I do need to use the 3.3v data line to communicate with the console regardless. Would it be ok to plug the 5v power and GND to the corresponding pins in the Due, and plug the 3.3v data line into a digital I/O pin? Would GND behave correctly then?
Thank you for your help!
EDIT: added some details and code
sketch_aug01a.ino (6.33 KB)