Showing posts with label adapter. Show all posts
Showing posts with label adapter. Show all posts

Monday, December 12, 2022

How to DIY Universal TRS MIDI Adapter

 MIDI is great. It's been around forever and lets all of our synths communicate with a simple protocol across a sturdy and robust 5-pin DIN connector. Unfortunately, as devices have gotten smaller and space on those devices becomes ever more valuable, many manufacturers have ditched the venerable 5-pin DIN connectors for the smaller (and cheaper) MIDI-over-TRS (TRS stands for Tip/Ring/Sleeve; it's known informally as 3.5mm stereo or "aux" cable). When I first learned of this shift, I didn't think much about it. My device came with a TRS-to-female-DIN adapter and that was that.

Until I got a second TRS-MIDI device and none of my dongles worked with it.

I'm not sure on the history of how this came to be, but there are actually two competing and physically incompatible MIDI-over-TRS standards, known as "type A" and "type B". Some manufacturers tend to use type A connections while others use type B. As far as I've seen, this information--that is, which standard any given device uses--is never printed beside the ports on the device, and it's very rarely on the adapter dongles (I've only ever seen it labeled on third-party adapters, never first-party).

Both standards use the same pins from a 5-pin DIN--the 2, 4 and 5 pins, to be exact--and both use pin 2 (the one at the bottom/middle) as the ground pin:

The only difference between the two standards is whether pin 4 is Rx and pin 5 is Tx or vice versa. Infuriatingly similar.

After buying and selling some synths, I've ended up with all of my devices using the same standard (I can never remember which) and not enough of the right kind of adapter to cover both input and output on all of them. I considered cutting up some of my adapters from the other standard to swap the polarity (i.e., to convert them to the standard my current gear uses), but I didn't want to keep dealing with this problem in the future, so I decided instead to use a DPDT switch I had lying around to make a universal, switchable TRS-MIDI Type A+B cable.

The first step in this process was to cut open my extra TRS-MIDI cable. You could also accomplish this by cutting up a cheap MIDI splitter cable and a spare TRS/3.5mm/aux cable, which would let you make two universal cables at the same time (to cover both your MIDI in and MIDI out). My cable has a green wire, a white wire and a shield around them, which connects to the ground pin.

So, the way a simple 2-way DPDT switch works is you have 2 pins in the middle and when the switch is turned one way, they bridge to the 2 pins on one side and when you flip the switch the other way, they bridge to the other pins, like so:

Now, looking at the underside of our DPDT switch:

we need to do a criss-cross bridge with some tiny jumper wires to connect our outside pins from one side of the switch with the opposite pins on the other side of the switch, like this:

Next, we solder one side of our cable's wires to the outside legs on one side of the switch, like this (it doesn't matter whether you do the TRS side or the DIN side of the cable; either works):

After that, we take the other side of our cable--whichever one you didn't use in the previous step--and solder its wires to the two inside pins, like this:

Once that's done, the last step is to connect your ground lines together. They're not involved in the switching process at all, so just link 'em up:

That's it. You're done.

I don't know why this problem even exists, and I don't know why nobody makes/sells switchable cables like this, but thankfully, we can deal with it ourselves with little fuss/investment.

Saturday, December 22, 2018

Retro Console RJ45 Pinouts - PS360+, MC-Cthulhu, Brook Retro Board

I build a lot of arcade sticks and I like to use them on old video game consoles, and the best way to do this is usually to get a control board that is compatible with multiple consoles. There have been a few boards that do this over the years, including Toodles' MC-Cthulhu (mostly discontinued but still available sporadically), Akishop Customs' PS360+ (discontinued) and now (at the time of this writing) Brook's Retro Board.

The preferred way to connect these boards to the consoles is via RJ45 connectors soldered to the board and then a console-specific connector soldered onto the other end of the cable. A few arcade parts stores sell premade cables for some of the more popular consoles at the time of this writing, but that will probably stop at some point, so it's good to know how to put these cables together.

There used to be a huge thread with really great tutorials on making these cables on the Shoryuken forums by user "rtdzign" but when SRK migrated to a different forum software a few years ago, it completely fucked up their post index so you can't get to things from google search results and I think the whole forum is shutting down completely soon, so all of this will be lost (most of it already is, really; I had to go sifting through the Wayback Machine's archives to collect most of this stuff).

Anyway, here goes (note: the pics in this post come from rtdzign's original tutorial on SRK and from Akishop Custom's PS360+ manual, with copyrights for those respective images belonging to them):

If you buy a MC-Cthulhu from somewhere, you may want to make sure you have the latest firmware. Toodles' "Godlike Controls" site has been down for a while, but the Wayback Machine cached the firmware file here.
Mirror

The ethernet connection pinout looks like this:

USB

The first cable you'll probably want to make is a regular USB cable (for PC and PS3). It's pretty simple - ground (pin 4 of the USB cable) goes to pin 1 of the ethernet cable, data+ (USB pin 3) goes to pin 5 of the ethernet cable, data- (USB pin 2) goes to ethernet pin 6 and VCC (USB pin 1) goes to ethernet pin 8.

Color - Purpose - RJ45 Pin - Cthulhu - ETH Color
Black - GND     - 1        - G       - Orange Stripe
---   - ---     - 2        - A       - Orange Solid
---   - ---     - 3        - B       - Green Stripe
---   - ---     - 4        - C       - Blue Solid
White - DATA-   - 5        - D       - Blue Stripe
Green - DATA+   - 6        - E       - Green Solid
---   - ---     - 7        - F       - Brown Stripe
Red   - VCC     - 8        - V       - Brown Solid

Original Xbox

Once you've done USB, OG Xbox is a logical next choice, as it's just USB with a proprietary plug:


OG Xbox also has a yellow wire that is unused and can be ignored, but otherwise it's the same as the regular USB cable.
NOTE: in general, don't trust wire colors blindly. *Always* test continuity with a multimeter to confirm wire-to-pin assignment. Cheap, knockoff extension cables are notorious for using essentially random wire colors (including nonsense like red GNDs, black VCCs, etc.)
If your construction skills aren't great and you would rather buy something, I believe you could also just use a USB-female-to-Xbox-male adapter like this one (or build one) and get the same effect pairing it with your newly constructed RJ45-to-USB cable.

Once you've got the hang of it, the rest of the consoles are just a matter of matching up the gamepad pins with the ethernet wires.

Gamecube

Gamecube (not compatible with PS360+) only uses the first 3 pins of the controller, which makes it pretty easy: controller pin 1 is VCC, which goes to ethernet pin 8, controller pin 3 is GND, which goes to ethernet pin 1 and controller pin 2 is DATA, which goes to ethernet pin 7. Easy-peasy.

Here's the diagram:

GC Pin - Purpose - RJ45 Pin - Cthulhu - ETH Color
1      - +5v     - 8        - V       - Brown Solid
2      - DATA    - 7        - F       - Brown Stripe
3      - Ground  - 1        - G       - Orange Stripe
And the same info in order of RJ45/Cthulhu pins:
GC Pin - Purpose - RJ45 Pin - Cthulhu - ETH Color
3      - Ground  - 1        - G       - Orange Stripe
---    - ---     - 2        - A       - Orange Solid
---    - ---     - 3        - B       - Green Stripe
---    - ---     - 4        - C       - Blue Solid
---    - ---     - 5        - D       - Blue Stripe
---    - ---     - 6        - E       - Green Solid
2      - DATA    - 7        - F       - Brown Stripe
1      - +5v     - 8        - V       - Brown Solid

N64

The Brook Retro Board has support for N64, and its pinout is very similar to the Gamecube's but in reverse order. That is, pin 1 is GND, pin 2 is Data and pin 3 is VCC (+3.3v).

N64 Pin - Purpose - RJ45 Pin - Cthulhu - ETH Color
1       - Ground  - 8        - G       - Orange Stripe
2       - DATA    - 7        - F       - Brown Stripe
3       - +3.3v   - 1        - V       - Brown Solid
And the same info in order of RJ45/Cthulhu pins:
N64 Pin - Purpose - RJ45 Pin - Cthulhu - ETH Color
1       - Ground  - 1        - G       - Orange Stripe
---     - ---     - 2        - A       - Orange Solid
---     - ---     - 3        - B       - Green Stripe
---     - ---     - 4        - C       - Blue Solid
---     - ---     - 5        - D       - Blue Stripe
---     - ---     - 6        - E       - Green Solid
2       - DATA    - 7        - F       - Brown Stripe
3       - +3.3v   - 8        - V       - Brown Solid

PS1 and PS2

PSX is another good one, since it covers both PS1 and PS2 and was considered the "standard" connector for sticks prior to the adoption of USB, so you can find PSX-to-whatever adapters fairly easily from companies like Raphnet. In fact, Akishop Customs recommends using a PSX cable with a PSX-to-Gamecube adapter to cover Gamecube and Wii inputs with PS360+ boards.

Note: the 'RUMBLE' pin carries 7.2v-9v for use by the rumble motors. We don't need to mess with it.


PSX Pin - Purpose - RJ45 Pin - Cthulhu - ETH Color
1         DATA    - 4        - C       - Blue Solid
2         CMD     - 3        - B       - Green Stripe
3         RUMBLE  - ---      - ---    
4         GND     - 1        - G       - Orange Stripe
5         +3.3v   - 8        - V       - Brown Solid
6         ATTN    - 5        - D       - Blue Stripe
7         CLK     - 2        - A       - Orange Solid
8         UNUSED  - ---      - ---
9         ACK     - 7        - F       - Brown Stripe
and here's that same data shuffled around to use the order of the RJ45/Cthulhu pins, in case that is easier to understand:
PSX Pin - Purpose - RJ45 Pin - Cthulhu - ETH Color
4       - GND     - 1        - G       - Orange Stripe
7       - CLK     - 2        - A       - Orange Solid
2       - CMD     - 3        - B       - Green Stripe
1       - DATA    - 4        - C       - Blue Solid
6       - ATTN    - 5        - D       - Blue Stripe
---     - ---     - 6        - E       - Green Solid
9       - ACK     - 7        - F       - Brown Stripe
5       - +3.3v   - 8        - V       - Brown Solid

NES and SNES

SNES / NES is another interesting case insofar as they use the same protocol, just with a different connector. Rather than making/storing/transporting 2 separate ethernet cables, I made one ethernet-to-SNES cable and use a self-made SNES-to-NES adapter for NES (also useful for using the more ergonomic SNES pad on an NES). I also have a cheap SNES-to-Wiimote-expansion adapter (this one from Hyperkin https://www.amazon.com/Hyperkin-Controller-Adapter-Classic-super-nintendo/dp/B075RMYMNH) but neither my PS360+ nor my MC-Cthulhu work with my SNES Classic/Mini through it, so YMMV (worth noting: MC-Cthulhu and PS360+ don't work with my Analogue Super Nt using the normal SNES cable, either, though they both work with an actual SNES console, so clearly something fucky is going on that probably won't ever be resolved for either of the essentially dead products). I haven't tried either of them running through a Wiimote's Bluetooth connection (to, for example, use an arcade stick wirelessly with emulators on a softmodded Wii), so if you try that, please let me know your results in the comments.

To be verbose, here are both the NES and SNES pinouts and pics, respectively (the "unused" pins are reserved for special controllers and serve no purpose for us):

NES




NES pin - Purpose - RJ45 pin - Cthulhu - ETH Color
1       - GND     - 1        - G       - Orange Stripe
2       - CLK     - 2        - A       - Orange Solid
3       - LATCH   - 7        - F       - Brown Stripe
4       - DATA    - 4        - C       - Blue Solid
5       - UNUSED  - ---      - ---     - ---
6       - UNUSED  - ---      - ---     - ---
7       - VCC     - 8        - V       - Brown Solid
And here it is sorted by RJ45 pin:
NES pin - Purpose - RJ45 pin - Cthulhu - ETH Color
1       - GND     - 1        - G       - Orange Stripe
2       - CLK     - 2        - A       - Orange Solid
5       - UNUSED  - 3        - B       - Green Stripe
4       - DATA    - 4        - C       - Blue Solid
6       - UNUSED  - 5        - D       - Blue Stripe
---     - ---     - 6        - E       - Green Solid
3       - LATCH   - 7        - F       - Brown Stripe
7       - VCC     - 8        - V       - Brown Solid

SNES



SNES pin - Purpose - RJ45 pin - Cthulhu - ETH Color
1        - GND     - 1        - G       - Orange Stripe
2        - UNUSED  - ---      - ---     - ---
3        - UNUSED  - ---      - ---     - ---
4        - DATA    - 4        - C       - Blue Solid
5        - LATCH   - 7        - F       - Brown Stripe
6        - CLK     - 2        - A       - Orange Solid
7        - +5v     - 8        - V       - Brown Solid
And sorted by RJ45 pin:
SNES pin - Purpose - RJ45 pin - Cthulhu - ETH Color
1        - GND     - 1        - G       - Orange Stripe
6        - CLK     - 2        - A       - Orange Solid
2        - UNUSED  - 3        - B       - Green Stripe
4        - DATA    - 4        - C       - Blue Solid
3        - UNUSED  - 5        - D       - Blue Stripe
---      - ---     - 6        - E       - Green Solid
5        - LATCH   - 7        - F       - Brown Stripe
7        - +5v     - 8        - V       - Brown Solid

TurboGrafx-16 / PC-Engine

TG16/PCE is kinda weird insofar as it has 2 functions on each pin (e.g. D-pad up and the I button) and then it uses the DATA SELECT pin to select which set of functions to poll.

I don't have a TG16/PCE, but from rtdzign:
The American TurboGrafx-16 uses has a female Din 8 port on the system while the Turbo Duo and all the Japanese systems use a Mini Din 8. I recommend that you buy a number of 6 ft monoprice Mini Din 8 cables. For an TG-16 you can buy a male Din 8 connector and solder that to an ethernet cable.

And here's the diagram sorted by DIN pin:
DIN Pin  - RJ45 pin - Cthulhu - ETH Color
1 +5v    - 8        - V       - Brown Solid
2 UP/I   - 2        - A       - Orange Solid
3 RT/II  - 3        - B       - Green Stripe
4 DN/Sel - 4        - C       - Blue Solid
5 LF/Run - 7        - F       - Brown Stripe
6 SELECT - 6        - E       - Green Solid
7 OE     - 5        - D       - Blue Stripe
8 GND    - 1        - G       - Orange Stripe
And sorted by RJ45 pin:
DIN Pin  - RJ45 pin - Cthulhu - ETH Color
8 GND    - 1        - G       - Orange Stripe
2 UP/I   - 2        - A       - Orange Solid
3 RT/II  - 3        - B       - Green Stripe
4 DN/Sel - 4        - C       - Blue Solid
7 OE     - 5        - D       - Blue Stripe
6 SELECT - 6        - E       - Green Solid
5 LF/Run - 7        - F       - Brown Stripe
1 +5v    - 8        - V       - Brown Solid

Saturn

Saturn pads have voltage lines running in and out of the gamepad. When you see diagrams online, they are typically named according to the console's perspective, rather than the controller's, so keep in mind that these names are basically backward.

Sorted by Saturn pin:

Sat Pin   - RJ45 pin - Cthulhu - ETH Color
1 +5v-OUT - 8        - V       - Brown Solid
2 DATA1   - 3        - B       - Green Stripe
3 DATA0   - 2        - A       - Orange Solid
4 SELECT0 - 5        - D       - Blue Stripe
5 SELECT1 - 6        - E       - Green Solid
6 +5v-IN  - ---      - ---     - ---
7 DATA3   - 7        - F       - Brown Stripe
8 DATA2   - 4        - C       - Blue Solid
9 GND     - 1        - G       - Orange Stripe
Sorted by RJ45 pin:
Sat Pin   - RJ45 pin - Cthulhu - ETH Color
9 GND     - 1        - G       - Orange Stripe
3 DATA0   - 2        - A       - Orange Solid
2 DATA1   - 3        - B       - Green Stripe
8 DATA2   - 4        - C       - Blue Solid
4 SELECT0 - 5        - D       - Blue Stripe
5 SELECT1 - 6        - E       - Green Solid
7 DATA3   - 7        - F       - Brown Stripe
1 +5v-OUT - 8        - V       - Brown Solid

3DO

3DO pads have headphone jacks on them, so 2 of the pins are dedicated to carrying audio signals, and there's a second VCC line. I would assume you can use either of them but haven't tested it, since I don't have a 3DO. Neither did rtdzign, it seems, as here's what he had to say about it:
(I don't have a 3DO and am assuming the D-sub follows normal pinout convention Picture is from a 3rd party genesis extension cable.)

3do will currently only work as the only controller, plugged directly into the system; trying to daisy chain off of it or use it through a daisy chain isn't going to work.

Here's the diagram sorted by Dsub pin:
Dsub Pin - Purpose - RJ45 pin - Cthulhu - ETH Color
1        - GND     - 1        - G       - Orange Stripe
2        - VCC+5v  - 8        - V       - Brown Solid
3        - AUDIO1  - ---      - ---
4        - AUDIO2  - ---      - ---
5        - VCC+5v  - ---      - ---
6        - P/S     - 7        - F       - Brown Stripe
7        - CLOCK   - 2        - A       - Orange Solid
8        - GND     - ---      - ---
9        - DATA    - 4        - C       - Blue Solid
And sorted by RJ45:
Dsub Pin - Purpose - RJ45 pin - Cthulhu - ETH Color
1        - GND     - 1        - G       - Orange Stripe
7        - CLOCK   - 2        - A       - Orange Solid
---      - ---     - 3        - B       - Green Stripe
9        - DATA    - 4        - C       - Blue Solid
---      - ---     - 5        - D       - Blue Stripe
---      - ---     - 6        - E       - Green Solid
6        - P/S     - 7        - F       - Brown Stripe
2        - VCC+5v  - 8        - V       - Brown Solid

Dreamcast

No VMU support and only works with games that can be played solely with an arcade stick. (update 8/4/23): Someone in the comments reported that the original pic was wrong, so here's a corrected pic:

 The diagram was always correct:

Here's the diagram sorted by DC pin:
DC Pin   - RJ45 Pin - Cthulhu - ETH Color
1 DATA1  - 7        - F       - Brown Stripe
2 VCC+5v - 8        - V       - Brown Solid
3 GND    - 1        - G       - Orange Stripe
4 SENSE  - 3        - B       - Green Stripe
5 DATA5  - 4        - C       - Blue Solid
And sorted by RJ45 pin:
DC Pin   - RJ45 Pin - Cthulhu - ETH Color
3 GND    - 1        - G       - Orange Stripe
---      - 2        - A       - Orange Solid
4 SENSE  - 3        - B       - Green Stripe
5 DATA5  - 4        - C       - Blue Solid
---      - 5        - D       - Blue Stripe
---      - 6        - E       - Green Solid
1 DATA1  - 7        - F       - Brown Stripe
2 VCC+5v - 8        - V       - Brown Solid

Sega Genesis / Mega Drive

None of these boards work with Genesis / MD because it does its own crazy thing that's very difficult to reproduce without spending a ton of money on dedicated parts. The best thing to do for these is to padhack a crappy 6-button pad, which can be purchased online for peanuts. See my post here for a look at that process.

MC-Cthulhu Secondary Solder Point Pinout

The Cthulhu boards include a double-row of unlabeled solder points on the side of the board opposite the RJ45 solder points. These are intended for attaching a 360 padhack for adding 360 support, but they're just additional hard-lines tied to the screw-terminals, so they can technically be used to add any additional PCB, so long as you tie the VCC and Grounds together.

Since they're unlabeled, it can be a hassle to use them, but you can easily identify by testing continuity between the solder points and the screw-terms. Nevertheless, I'll include the pinout here to make it easier (the labeling scheme assumes right-alignment; that is, H and 9 are on the far right, lined up, while A and 1 are staggered on the left side):

    [A] [B] [C] [D] [E] [F] [G] [H]
[1] [2] [3] [4] [5] [6] [7] [8] [9]

A = VCC
B = Down
C = Ground
D = Select
E = Right
F = 3K ('Roundhouse' in Street Fighter nomenclature)
G = 3P (Fierce)
H = 1P (Jab)

1 = Up
2 = 4P (PPP)
3 = Left
4 = 4K (KKK)
5 = Start
6 = 2K (Forward)
7 = 1K (Short)
8 = 2P (Strong)
9 = Home/Guide

And, just because I keep needing it and don't feel like searching for it every time, here's a copy of the MC-Cthulhu pinout:

Sunday, April 3, 2016

SCART to JP21 Adapter - Solderless DIY

Most of my consoles are setup for RGB output via SCART connection, and SCART cables and converters are much easier to find than ones wired for JP21. However, my XRGB-Mini Framemeister  only takes JP21, so I've searched all over for a low-cost SCART-to-JP21 adapter to no avail. There's one from a store in the UK that costs like $40+international shipping, which is just too expensive, IMO, and a SCART-to-Framemeister-mini-DIN from retro_console_accessories on eBay (the source for the best-quality retro gaming cables anywhere) for ~$30, which is a bit more reasonable but would cause wear-and-tear on the Framemeister's already-finicky mini-DIN port. Neither of these options seemed very attractive to me, so I figured I'd try the DIY route using a cheap Chinese SCART-passthru-breakout-whatever available for <$4 shipped on eBay:
I'm not altogether sure what the intended purpose of these things is but whatever...
They're sealed shut pretty well but the most effective strategy for cracking them open seems to be applying steady pressure on the sides toward the female end (the curved/scalloped part next to the male end is stronger). I used a C-clamp and slowly tightened it until the clamshell halves started buckling and then popped apart. A bench vise would work well, too.

Once you pop it open, you can cut the wires from the breakout jacks, which will clean out some of the rat's nest inside. In my case, all of the wires were black, which... isn't great:
The input/output switch isn't glued in, so you can remove it and save it for another project.
The female side is soldered in and attached pretty tightly, but the male end is actually pretty easy to work with. Each of the spade-type prongs is secured with a little popout leg in the middle. You can squeeze that in with needle-nose pliers and then press the whole prong inward and pull it through from the inside:
Here you can see one of the removed spade-prongs, with the popout locking mechanism.
Once they're all pulled through, you can rearrange them to match the JP21 pinout and push them back through, as per this key (not my pic, but I'm re-hosting it here because the original Tinypic hosting could vanish at any time):
You'll notice the SCART side has one less ground and one more white, unlabeled prong than the JP21 side. I just left that prong out entirely (#12) and everything still seems to work fine.
Once the prongs are all reordered, you can use a small pokey thing to engage the center-locks, no soldering required. I used a cheap dental tool I had laying around to do the job, but those little pointy electrician's tools (the ones that look like dentists' tools with screwdriver handles) should work fine, too. After that, just glue the casing back together and you should be all set.

Monday, September 7, 2015

SNES to NES Controller Adapter

Historically, the SNES was originally intended to be backward compatible with the NES, with a CPU from the same 6502 lineage as the NES and a similar controller signal protocol over the same 5 wires: data clock, data latch, serial data, +5v and ground. The SNES signal has more data clock pulses after the data latch pulse but the protocols are the same, otherwise. This means that if you make a pin-to-pin adapter that sends SNES controller signals to an NES port, everything works just fine and the NES will just ignore the extraneous clock pulses.

Now, original NES controllers are getting fairly expensive these days--particularly the "dog bone" controllers that are round instead of pointy--and the third party reproductions from Tomee et al. are pretty universally reviled for being flimsy, unresponsive and altogether crummy. SNES controllers, on the other hand, are more ergonomic, originals are generally more plentiful and some of the repros (like this one) are actually pretty great. I also already have a bunch of SNES controllers, including an ASCII Pad, which is possibly the finest third party controller ever produced...

So, with all of that in mind, I cobbled together an SNES to NES controller adapter (there are a number of guides online, see also: here and here, among others) using a couple of cheap extension cables, specifically Tomee NES extensions (I found a set of 2 from an eBay seller for $9) and "Gen" 2-pack SNES extensions. I'll post which wires I connected, but it seems the factories that produce these extension cables just pick a handful of randomly colored wires when they put them together, so don't assume they'll apply to your own cables in any logical way:
NES side   |   SNES side 
  Yellow  <->  Black 
  Orange  <->  Green 
   Black  <->  Red 
    Blue  <->  Yellow 
   Green  <->  White
Ideally, you would figure out which wire carries which signal using a multimeter but mine is on the fritz, so I just trial-and-errored my way through it, which was a pain in the ass, but whatever. It worked in the end. Interestingly and unexpectedly, NES' B-button becomes the SNES' Y-button, and NES A becomes SNES B, which is really fantastic, since the angle of the SNES B and A buttons would make them hard to press at the same time had the naming/mapping been consistent.

Analytics Tracking Footer