Micro USB Audio and Link Cable

The discussion in the general hardware thread was getting heavily focused on this one development and I’m going to need to continue to add more updates so I’ll break it out here and once I get so some kind of resolution I’ll update the wiki on the hardware page.

The goal is to try and get audio out through the micro USB port and also enable a link cable.

This is the working schematic that is the start of this discussion:
e6f41fa8120589ae033c88bd5c0b9b131843971b_1_500x500

2 Likes

I have ordered 2 cell phones that are to support audio over the Data Lines and a load of adapters that are supposed to work with them.

I have also ordered a micro-usb to micro-usb OTG cable. This would be used for a link cable. The assumption at this time this is not a cross over cable, this needs to be tested. If it is not a cross over cable, the hardware RX/TX lines cannot be used and a software serial library will be needed.

This thread will be used to document the results as I try to determine how this “standard” operates.

If hijacking the data lines is unsuccessful then using pin 4 for audio out will be explored. In the current schematic it shows connected to the speaker but I think it is better to use an different pin so that a one-wire communication protocol could be established.

2 Likes

Couple of thoughts about a potential link cable:

  • If this is a serious feature then we should aim for a launch title that uses it. There are probably some existing games that could add multiplayer support (e.g. Bone Shakers :smiley: )
  • If you are planning to do a kickstarter or similar then a pack with 2 x Arduboy FX + link cable reward would be great for getting people on board with the idea of multiplayer

It is sort of a shame that the original Arduboy won’t be able to support it as there are probably a few people who will have an Arduboy + Arduboy FX but not many people will buy 2 x Arduboy FXs

Yah well theoretically this hardware should have been the origonal setup but I didn’t know what I was doing then. It’s kind of a miracle the original one even works.

100% agree with this!!!

Bone shaker’s isn’t a bad idea! My game, Festive Fight, could use the link cable, too. Right now, 2-player mode is just sharing the one Arduboy between two people, sharing the buttons. :stuck_out_tongue:


I’m also wondering what asymmetric features that we could offer. For instance, on the Nintendo DS, there were some features where you could plug a Gameboy Advance game into the bottom slot and a DS game in the top slot to transfer all sorts of data one way or the other. Pokemon let you transfer your creatures from the GBA game to the DS. Also, the Wii U had asymmetric gameplay in a lot of multi-player games considering that it only had 1 single screen.


Another note, there was a Gameboy game that could support 16-player multiplayer. It was a clunky FPS, but I wonder if there was a simple technique they used to daisychain Gameboys that the Arduboy could do using this link cable method.

(Video of 2 people playing)

2 Likes

I think we should be able to send games to each other? Wow that’s gonna be a program.

I might have a solution for the cross linked cable:

Put two USB type A female connectors on a small PCB and cross link the data lines and a FX link is born :slight_smile: With SMD pads it may even be thin enough to include in the package :smiley:

Out of interest, how come it is possible to communicate between Arduboy / PC via USB serial but you couldn’t for example hook up two Arduboys together and use the data line used for serial connection? Is there some hardware limitation that enforces a USB host/slave arrangement? I’m not very knowledgeable on the hardware side of things and just interested to understand how it works.

Also, if we have a data line out for audio / link cable, would it be feasible to make some sort of TV out mod in the same way?

1 Like

From this site:

It’s important to understand that USB is a Master/Slave technology. The PC is the Master, and your peripheral device is the Slave.

The PC “polls” the peripheral device: it can send OUT data to the device any time it wants, and the PC expects to be able to read IN data from the device any time it wants. The device can only wait with its data until the PC host decides to ask the device for it. (Despite the fact that one of the USB transfer types is called “Interrupt” type, the slave device cannot actually interrupt the PC at all.)

This Master/Slave relationship between the PC Master and the peripheral Slave means that the USB hardware on each end is very different. A USB peripheral device does not have the right kind of USB hardware to command another USB peripheral, so please don’t expect to be able to turn your inexpensive microcontroller-based USB peripheral device into something that can control another USB device like a printer.

It can’t happen, unless you buy a more complicated micro that contains special hardware that can enable it to act as a USB “Host,” and go through all the steps to program it to do all the extra work that a Host needs to do.

@Pharap is on it but the USB standard requires a device to initalize as a host or a device. In order to be a host the microcontroller has to support it. It can be done with V-USB I’m not sure how thick the stack is for implementing a host though.

But the issue with that stack is it can’t control the USB pins, and I’m pretty sure the hardware pins for the USB are unidirectional. Meaning the TX is unable to be an input, which would be required for a micro-usb to micro-usb (OTG) connection.

But if we used AUX pins to hijack the usb lines theoretically if the usb host stack from v-usb could be adapted, it could be done.

I think I recall someone developing an independent arduboy flasher, I know some have been built on raspberry pi. I think it was a teensy 3 or something that supports host mode.

Thanks for the replies. So if I am understanding this correctly, the microcontroller is unable to directly pull any of the USB pins high / low from code? The USB host is the only one controlling how data is transferred?

I have previously experimented with an Arduino and generating TV composite signals. If I remember correctly it required 2 pins plus ground. Do you think that the mod for audio output could be used for video too? Would be neat to be able to hook up to a TV

1 Like

Yes. Because the ATMEGA32U4 has a hardware USB controller built in. The MCU communicates with that only and can’t control the USB pins.

That’s why I came up with the idea to hook the Rx and Tx pins to the USB Data lines.
But in order to do that the ATMEGA32U4 should better run on 3.3V. (I’m not sure what the effect will be if a level shifter is hooked to them. The only candidate for this would be TXB0104 or TXB0108 since those are auto directional sensing)

If my idea works, you can configure Rx and Tx pins as general output pins for your TV out :wink:

You would need a special cable made of a resistor ladder but for sure yes. 5225072558_5f5f760037

This actually would still leave audio available on pin 4 with blinkys suggested mod.

1 Like

Ah dammit it’s a shame RX and TX pins aren’t also capable of PWM, tying a total of 6 pins to 2 data lines is kind of wacky. Do we even have enough pins to do that? And that still leaves the crossover cable problem.

Although… having a crossover cable that adapts two mirco cables may actually be a better solution. Actually that adapter can also have the audio jack too… 2 female usb A connectors and an audio jack.

Do you blow up anything if you try to do crossover connection to a normal USB device? :laughing:

1 Like

When reading this I think you won’t.

Wait no can’t use an adapter to pull out pin 4 as it isn’t passed through to a Type A connector.

In order to get at pin 4 you’ll have to have a custom cable.

With RX/TX and Aux1 and 2 connected, you would be able to do multiplayer or audio or video but not at the same time and the code would have to be specifically written to use it.

You would need a link adapter and 2 micro usb cables to link them together. The adapter crossing over the data lines. The adapter would also have an audio jack in series with the data lines. Theoretically you could create a data bus and with an aux cable could have 4 way multiplayer? It would have to be done in software because the RX/TX lines are not daisy chained in this config.

This also means for anyone not wanting to buy the link cable, all they gotta do is cut up a normal usb cable and not have to worry about sourcing a 5 pin connector. I could also put the resistor ladder in front different pins on the jack so that you would just need a 1/8th to rca adaptor? Maybe a L/R splitter first I guess.

1 Like

Well all the adapters and the LG came in. The LG does not turn on despite it having a QR code on it that says “Tested” and the auction showed it working.

Hopefully it’s just the battery and maybe I can directly power it? Either way I can inspect the PCB. Let’s hope the other phone works so I can test functionality.

Too bad it doesn’t work. Did they include the battery?

For the adapter. I’d say keep it simple. adding the TV out resistors to the adapter may interfere with non TV functions.

Multiplayer kept me thinking and made me realize I2C may be better to use instead (Use SCL and SDA) will look more into this.

We can simply daisy chain Rx Tx.

with two Arduboys they are simply crossed:

  • Arduboy 1 Tx to Arduboy 2 Rx
  • Arduboy 2 Tx to Arduboy 1 Rx

with 4:

  • Arduboy 1 Tx to Arduboy 2 Rx
  • Arduboy 2 Tx to Arduboy 3 Rx
  • Arduboy 3 Tx to Arduboy 4 Rx
  • Arduboy 4 Tx to Arduboy 1 Rx

To illustate it with a picture:

By adding a DPDT (Double Pole Double Throw) switch, a switchable 2 player / 4 player version could easily be made.

3 Likes

The cost of a 4 way adapter is twice as expensive and the odds of anyone ever having 3 friends is pretty small.

1 Like