For fun and because I needed one, I set out to build a JAMMA SuperGun. (It's not a weapon, by the way. It's an adapter for arcade games ;P). There are some guides on the web to do so, but factual information is scarse and none of the designs I've seen matched what I wanted. So here's my little contribution to the world of SuperGuns.
Disclaimer
The information and methods described herein are provided "AS-IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your devices. Proceed with caution, and although it is highly unlikely that accidents will happen because of following advice or procedures described in this document, the author does not take any responsibility for any damage claimed to be caused by doing so.
There. Feeling better. Now let's get real ;-)
Note: I've updated the design (it's at the end of this page), but do read everything since the upgrade comes practically without any detailed explanation.
Design goals
My design goals were relatively simple:
- KISS design
- Drive all JAMMA variants:
- MVS
- Boards requiring -5V
- Mono and stereo capable
- Can be built "by hand"
- Should remain relatively inexpensive
Technically speaking I added the following constraints:
- Power source: ATX PSU
- Outputs:
- Peritel (SCART)
- S-Video
- Composite
- RGB over VGA and BNC with separate H/V sync
- Separate audio output
- Separately adjustable R, G and B inputs
ATX power source, though not necessarily very convenient, greatly simplifies the design given the power requirements of JAMMA boards. SCART, S-Video and Composite make for the widest possible connection choices (Component or HDMI is meaningless: we're talking 525i/576i here, remember?). BNC/VGA is a personal touch, pretty much useless unless you have the right hardware to plug to (typically old 15 kHz arcade CRT monitors), but it's made optional in the design, see comments below. Finally, separate audio is necessary if S-Video/Composite are being used, and it also allows for plugging the SuperGun into an audio amplifier.
Schematics
Here's the schematics of my very first design:
The partlist is here.
Before we get deeper into details, a few words on JAMMA signals.
JAMMA signals
The pinouts can be easily found on the web. What's less obvious though are the actual signal voltages to expect on each outputs, or those to provide on logic inputs.
First things first, all logic inputs are active low. Considering the values of resistors suggested by some SuperGun designs, and also considering the technology of JAMMA boards (TTL circuits...) I was expecting most outputs to be around +5V. Turns out I was close. Here's a quick summary of the level ranges I've measured on MVS and some JAMMA PCBs in a somewhat empiric manner:
- Logic inputs high state: +5V DC
- Video sync: 0-3V AC swing, 0-5V DC bias
- RGB signals: 0-3V AC swing, 0-4V DC bias
- Audio: 0-6V AC swing, no DC bias. On mono boards, each lead is sometimes a few Volts above GND (ca. 5-6V), both leads at the same potential so no DC bias in a balanced configuration anyway.
Audio leads normally drive a 8 Ohm speaker, delivering about 5W of max output power.
Finally and for reference, it seems generally understood that typical JAMMA boards will expect to be able to draw at least:
- 6A@+5V (I've seen comments about up to 15A for some multigames/multiboards systems).
- 1A@+12V (up to 2A according to some).
- 1A@-5V (this is optional, most JAMMA boards don't need -5V apparently).
All in all, that's about 50W give or take, so no need to get psyched up with jumbo PSUs ;-)
Schematics explanation
With the above in mind, most of the design should be self explanatory. Modern TVs and A/V devices require the following signal levels:
- RGB inputs: 0.7V AC, 0-2V DC bias
- Audio inputs: 0.2-2.0V (nominal 0.5V) rms, NO DC bias
- SCART-specific signals:
- Composite sync: 0.3V AC, 0-2V DC bias
- SWTCH: 12V DC for 4:3 video (most TVs will auto-switch to Peritel input when voltage is present at this pin)
- BLNK: 1-3V DC (nominal 1V DC, used to tell the TV it needs to read RGB signals, and sometimes switch to Peritel input)
- All other signals are TTL levels (e.g. H and V sync)
All non-TTL signals - but audio - are loaded on 75 Ohm impedance. Audio is normally loaded on high input impedance (>10k Ohm).
Audio section
Audio section needs to do two things: adapt signal levels to line input standards (0.5V rms on a typical 47 kOhm input impedance), and cope with both mono (replicating signal on both left and right outputs) and stereo boards.
The usual divider resistor bridge solution is WRONG. In mono configuration, if + and - leads are each side of a balanced H-bridge amplifier design (commonly found when there's a need to generate a balanced output from a single positive power supply), the divider bridge will ground one of the legs of the "H" which is potentially lethal to the amplifier.
The proposed solution can accommodate both mono H-bridge and regular unbalanced stereo amplifiers, through the use of isolation 1:1 transformers. The 1:1 ratio makes all calculations easier: secondary impedance seen from primary will be equal to the load on secondary, and vice-versa. The transformer makes no level adjustement, so we can make these adjustments ourselves. Audio power amplifiers are fixed gain amplifiers adjusted to a given load. If the amplifier delivers 5W on 8 Ohm, it will deliver about 90mW max on a 440 Ohm load.
We want to divide by 10 the voltage while presenting a ca. 440 Ohm load to the audio amplifier. The divider bridge suggested has a ratio of about 0.1 giving us the circa 0.5V max output swing we're looking for, with the 440 Ohm load we need. Indeed, the high 47 kOhm secondary impedance seen from primary is negligible in front of the low 50 Ohm "in parallel" so the resulting divider is almost 50/(390+50). Output impedance (primary seen from secondary) is in the tens of Ohms which is what we need. Finally, the transformers can handle 100mW, this gives some leeway vs maximum power dissipation, but in any case heavy distorsion will be heard much before reaching a potentially destructive power.
Note: there's no AC coupling (no capacitor on the signal path) because I didn't think it was necessary: on the input side, JAMMA boards' output should be clean enough. They're driving a 8 Ohm speaker, any significant DC bias would destroy it, much more than such (reduced thanks to the higher load) bias would destroy the transformers. On the output side, measurements show that secondary DC bias is negligible, as expected. Also, 1/4W resistors are just fine. Given the load, they won't see half that much power, and if something goes wrong, they'll be nice little fuses.
Note: the audio section drives both the RCA outputs and the SCART audio signal. Pluging both SCART and RCA plugs at the same time shouldn't pose a problem given their respective input impedance.
Video section
The video section takes care of two things again: adapting the signal levels and also converting RGB to Composite and S-Video.
RGB
Given the measured signal levels, a ratio of about 0.3/0.2 will give us the required 0.7V swing, withing acceptable DC bias range. Sice the video converter (AD725) requires the usual 75 Ohm input impedance, the divider bridge naturally becomes: 75/(180+75) = 0.3. The supplementary 250 Ohm potentiometers are used as variable resistance. Most of the time they will be all the way to the right (short circuit with the proposed wiring), giving the divider bridge its above nominal value. If need be (very strong input signal, or color imbalance) they can be used to adjust the ratio up to about 0.15. This gives good results and in the worst case scenario of a 5V input swing, the resulting output will be slightly over 0.7V, which should be OK.
The triple video amplifier (AD8073) isolates direct level-adjusted RGB outputs to plugs from the converter's input. The converter needs a constant load, without the amplifier, plugging the SCART, VGA or BNC would change the circuit impedance. The amplifier is used in a typical double gain, the final 75 Ohm resistance at the end of the signal path will divide by 2 whenever a standard 75 Ohm load is plugged. This drives SCART, VGA and BNC, not two of which can be plugged at the same time. Also, BNC/VGA will normally not work on most computer monitors, they generally do not handle the low sync speed required by NTSC/PAL signals. Circuitry to adapt the signals to such monitors requirements is on my TODO list :-)
The sync separator (EL1883) receives a load-adapted synchro input, and outputs a "clean" composite sync signal at the right level for the SCART plug, and separate H-/V-sync for VGA, BNC and the video converter at TTL level. Selected RSET values (as per datasheet) are expected to give good results with both PAL and NTSC signals. As far as I could see, it works nicely.
Note: Since each RGB output plug (SCART, VGA, BNC) is basically shunt over the same signal, at most one of them can be plugged at any time for proper operation.
Composite/S-Video
The rest of the circuit converts the RGB signals into Luma/Chroma and Composite video to drive the remaining two video outputs.
4 gates on the hex-inverter (74HC04N, which must be CMOS to handle the relatively high frequencies) are used to create two oscillators at 4 times the Frequency Sub Carrier (4FSC) for PAL and NTSC, driving the 4FSC input on the AD725. The values of capacitors and resistors are not very sensitive. It's best if the series-equivalent capacity of the capacitors net matches the crystal's recommended value. The variable capacitor allows for fine tuning should the need arise, but can be omitted. The inductance L1 on the Vcc path is meant to reject high fequency noise, together with the 10nF capacitor. I don't have a typical value to suggest, a few mH should do. The idea is to get a few MOhms impedance at about 15Mhz. Remember Ohm's law: Z = 2πLf, with Z in Ohms, L in Henrys, and f in Hz.
Everything else is done by the video converter (AD725). The STND_SW switch selects PAL or NTSC video standards depending on the connected game, and the outputs are AC-coupled and 75 Ohm terminated as they are twice the required level. I didn't bother using the Luma-trap, I didn't feel it was worth the effort ;) Chip-Enable is tied to +5V, I don't bother turning the chip on and off. I also didn't bother separating AGND/DGND.
Note: The S-Video and Composite output plugs can be used together, and since they're independent from the RGB outputs, it's also possible to use them with either one of SCART, VGA or BNC plugged. If you did not implement VGA/BNC, then you can basically use all the outputs at the same time ;-)
Remaining bits of interest
Not much more to say. There's abundant DC-coupling on each IC's Vcc inputs to provide backup power during spikes and to reject high frequency noise.
LED1 is wired on +5V and is meant to indicate board's operation. LED2 is wired on -5V, as not all ATX PSUs supply -5V (in particular ATX2.0 PSUs generally do not supply -5V). Regarding -5V, it serves two purposes: provide -5V to JAMMA boards that require it (most don't), and provide negative supply to the video amplifier, since RGB signals go all the way down to ground during H-sync. A rail-to-rail amp would have been necessary in order to get rid of the -5V there. Now, the board will function even without -5V, provided that you connect the -5V rail (pin 5/E on JAMMA) to ground. RGB output will be slightly distorted at the top of the picture, Composite/S-Video will be unaffected.
Parts that can be optionnaly removed
The design is very modular. Without affecting functionality, LED1, LED2, all input/output plugs; and of course the related resistors can be removed. If you're not going to use RGB outputs at all, the whole AD8073 block with accompanying RC circuitry can be removed. Similarly, if you don't care about S-Vid and Composite, the 74HC04N, AD725 en EL1883 (and related RC) can be removed, provided that you leave R1 in place and connect its end point to the SCART's pin 19. If you're going to use the further provided layout, watch out for components which are used as via points between layers.
Layout
Here's a very simple two-sided layout that fits on double size Eurocard PCB.
Ready for you to insolate, I'm providing:
- The Solder Side (printed side against the board)
- The Component side (printed side against the board)
- The Silkscreen (for parts placement)
ATX Plug Hack
This layout will need two drops of black marker pen on the solder side to accommodate my little hacks on the ATX plug: I'm not using the PWR_OK pin, which is why I'm running the -5V wire over its pad. Fill it in and cut off the pin on the plug. Also, the plug I used doesn't need mounting holes (hence the route for the +5V track), and I was too lazy to redo the plug's package imprint. For better GND connection, fill in the other hole. See this scan for details.
Comments
This layout is fairly straightforward. Routing has been done by hand and it uses a ground plane for all the usual reasons (simplified routing, better shielding against noise and better coherence of the ground level across the whole PCB). Audio is self-contained and as far away from potential "polluters" as possible. Connectors on 3 sides slightly complicates box-fitting but if you don't need VGA and BNC (and you most likely won't) then "problem solved". Switches are expected to be remote wired (i.e. not soldered directly to the PCB, but rather placed on the casing and then having wires routed to them). The JAMMA terminals are 1-1 with the JAMMA connector, this is suboptimal but less error-prone when it comes to wiring it.
Everything can be soldered by hand, even though the 2 SMDs will require some skill (tip: put a drop of tin solder on e.g. pad 1 without the part, then put the part in place, heat pin 1 which will melt the solder under it, wait for it to cool down: the component is placed and won't move, you can now solder the remaining pins. Use 0.5mm solder tip).
For what it's worth, I've built a board with this layout and it works ;-)
Upgrades
Now that this prototype design is known to work, I've planned to refine it further. In no particular order, here's a quick list of things I'd like to tackle:
- Reduced JAMMA terminals footprint. -> done in v0.2
- Generate -5V supply (i.e. be compatible with ATX2.0 PSUs). LM7905 comes to mind but has terrible efficiency, especially considering some boards will need around 1A on the -5V rail (unless the -5V only serves to power the audio stage, in which case the current draw will be much less given our load change). Need to investigate other options (turning a LM2575 or similar into a negative buck regulator...). -> partially done in v0.2
- Expanding further: possibly operate from a more conventional power source, maybe even only from 12V DC.
- Scanline doubler/converter for true VGA output (look into the likes of AL250).
I have no ETA regarding any of these improvements, it might be tomorrow, it might be in 10 years, I don't know. Odds are, I'm gonna go step by step (the first two items should be quite straightfoward), and post updates here as I go.
Another thing I'm likely to do soon is build a tiny converter for good old Sega Genesis pads to use them with the SuperGun without having to modify them anyhow. It's relatively simple on the paper, I'm thinking about using a PIC to handle everything.
v0.2 Upgrade
Note, read everything above before reading any of this.
Ready for you to insolate, I'm providing:
- The Solder Side (printed side against the board)
- The Component side (printed side on top)
- The Silkscreen (for parts placement)
- The partlist is here
This is my first upgrade to the design. While I kept most of the design rules from the initial design, the specific changes are as follows:
- Use of WAGO series 233 terminals to reduce footprint.
- Operate the PCB from ATX2.0 PSU: generate internal -5V from -12V input to drive the AD8073.
- Add a few "informational" LEDs.
- Get rid of unused VGA/BNC outputs.
- All connectors/switches (but the test switch) on front/back.
- Fit on a standard size Eurocard PCB.
Though seemingly simple, those changes implied a few things.
Routing (still done by hand) has been quite trickier, especially
since I wanted to keep vias to a bare minimum. The D1
diode is there to ensure that the voltage applied to the STND
pin of the AD725 doesn't fall under 2V when NTSC is selected,
since the AD725 needs 2V or more to trigger, and some LEDs may
have a threshold voltage below 2V. R35 limits current
flowing in LED4, and prevents shorting of +5V with GND when
the switch is manipulated. The wiring of the JAMMA plug
to the WAGO connectors is no longer sequential. To facilitate
routing I took some liberties with the wiring sequence (see
below). The LM7905 generating -5V should be just fine
without a dissipator, provided that you NEVER try to
use it to power up the -5V rail on a JAMMA board ;-P
Also, I used the same ATX plug hack as before,
although I did improve the package imprint this time.
All outputs can be used at the same time, and the design is
as modular as before too.
LED explanation:
- LED1 - indicates presence of +5V (i.e. PCB powered).
- LED2 - indicates presence of internal -5V (i.e. AD8073 powered).
- LED3 - indicates presence external -5V (optional, to power -5V JAMMA rail if needed).
- LED4 - on: NTSC selected / off: PAL selected.
WAGO wiring (slots numbered from right to left):
| WAGO X1 | JAMMA | WAGO X2 | JAMMA | WAGO X3 | JAMMA |
|---|---|---|---|---|---|
| 1 | 26 | 1 | 10 | 1 | GND: 1,2,A,B |
| 2 | 17 | 2 | L | 2 | GND: 14,27,28,e,f |
| 3 | 25 | 3 | 15 | 3 | +5V: 3,C |
| 4 | 24 | 4 | R | 4 | +5V: 4,D |
| 5 | 23 | 5 | P | 5 | -5V: 5,E |
| 6 | 22 | 6 | 12 | 6 | +12V: 6,F |
| 7 | 21 | 7 | N | ||
| 8 | 20 | 8 | 13 | ||
| 9 | 19 | ||||
| 10 | 18 | ||||
| 11 | d | ||||
| 12 | U | ||||
| 13 | c | ||||
| 14 | b | ||||
| 15 | a | ||||
| 16 | Z | ||||
| 17 | Y | ||||
| 18 | X | ||||
| 19 | W | ||||
| 20 | V | ||||
| 21 | 16 | ||||
| 22 | T | ||||
| 23 | - | ||||
| 24 | M |