Whirlwind - PC to JAMMA Arcade Cabinet Interface
by baritonomarchetto in Circuits > Electronics
2372 Views, 5 Favorites, 0 Comments
Whirlwind - PC to JAMMA Arcade Cabinet Interface
My very first Instructable was about an interface (Jammarduino) to connect a genuine arcade cabinet with JAMMA wiring to a PC. It was the proof of concept of a cheap DIY Arcade interface board with even more features than commercial products.
Then Earthshaker followed, a low cost and trimmed down version based on 32u4 microprocessors. This was developed for those cabinets with a limited number of inputs, like one player cabs and JAMMA racing cabinets. Cheap, but limited in terms of maximun number of inputs and processing power (oh well...).
It was then time for Monsterbash, a bulky, arduino DUE based, full featured interface board. In more than one aspect a nice copy of the first Jammarduino prototype because of the dedicated printed circuit board (PCB) and the built-in audio amplifier. It featured full compatibility with JAMMA standard and a relatively fast microcontroller (Atmel SAM3X8E ARM Cortex-M3). The main con was the cost: Monsterbash was more expensive than Earthshaker, even WAY more expensive nowadays that microcontrollers prices have skyrocketed.
The present Instructables deals with the development of the last (but not least eventually?) Jammarduino iteration: Whirlwind. Based on Raspberry Pi Pico, it makes all the previous versions obsolete.
Let's see how! :)
Supplies
Here follows the bill of materials (BOM):
Boards:
- 1x Whirlwind PCB
- 1x Raspberyy Pi Pico 30 INPUTS CLONE microcontroller board
Video amplification and handling circuit:
- 1x VGA PCB mount female connector
- 1x THS7374 video amplifier
- 1x 1N4148 diode
- 1x 820 ohm resistor
- 3x 500 ohm trimpots
- 1x 2K ohm resistor
- 2x 1K ohm resistor
- 1x 4.6K ohm resistor array (with common pin)
- 1x 220 ohm resistor
- 1x 22 uF electrolitic capacitor
- 1x 100 nF poly capacitor
Audio amplification circuit:
- 1x LM386N-4 audio amplifier
- 2x 10 uF electrolitic capacitor
- 1x 220 uF electrolitic capacitor
- 1x 47 nF poly capacitor
- 1x 22 nF poly capacitor
- 1x 100 nF poly capacitor
- 1x 10 ohm resistor
- 1x 5100 ohm resistor
- 1x 10K ohm trimpot/potentiometer
- 1x 1N4004 diode
Others:
- 2x 20 pin female headers strip line, 2.54 mm spacing
- 1x VGA cable
- 1x audio cable
I will assume you have a soldering station and some tin by hand and you know how to use them.
About the microcontroller board: you are in the need for one of those Pi Pico clones with alternate pinout (see attached picture). These alternate pinout boards are commonly in purprle color, but you can also see them in black. The same is true for standard pinout boards: often seen in green, but also in black. The message is: do not trust the Pico PCB coloration.
Again: a standard pinout Raspberry Pi Pico will not work here! It has a different and non compatible pinout with the Pi Pico this project is built around.
Schematics and Circuit Description
Unconventional colored scheme of the project to the rescue! :)
Raspberry Pi Pico (30 pin variant clone) is the brain of the project and in charge of a whole lot of tasks:
(a) it monitors the video sync frequency
(b) keeps track user inputs (button presses, potentiometers positions, etc.)
(c) emulates the Human Interface Device (HID) of choice.
The microcontroller translates control panel buttons, coin switch and service switches actuations into keyboard key presses or joystick buttons presses (or whatever you want them to do!).
Pi Pico is powered by the USB port it is connected to and there's not the need for an additional power supply.
Incoming RGB signals from the PC video card VGA connector are directed to the video amplifier circuit (THS7374). On the video amp output stage a set of tree trimpots helps adjusting the R, G or B signal to fine tune the image colors.
Please notice that the 2X gain the THS7374 provides could be not sufficient to gain a decent RGB amplification in some arcade monitors (i.e. Nanao). In such case a THS7375 (5X gain) could be a better choice. The sync signal passing the amplifier should not exceed 5V (the peak output tension for such IC's), but it's worth a check (you do not want to fry the monitor ASIC). Untested!
Depending on the type of CRT monitor you are using (arcade or a replacement TV) the "right" impedence differs from 75 ohms in CRT TVs to some hundreds of ohms in arcade monitors (200 being the optimum for my Hantarex, in example). Those trimpots also help in facing cathod-to-cathod differences due to ageing.
The video amplifier adopted has a very handy feature: a disable pin. This allows it's direct control from the microcontroller monitoring the sync frequency. The amplifier can be powered @ 3.3V or 5V. Powering at 5V allows for a wider range of input voltages/signals and being that THS7374 can be controlled by 3.3V signals even if juiced at 5V, you name the obvious choice.
The video amplifier circuit is powered by the USB port the Pico is connected to and don't ask for an additional power source.
JAMMA standard calls for composite sync, while VGA delivers a separate sync signal. A very simple sync circuit made of a resistor and a diode convert separate sync to composite sync .
A voltage divider lowen the 5V composite sync signal to 3.3V logic (RP2040 is not 5V tolerant!).
Three analog inputs are directly accessible via screw terminals. They can be used to interface positional guns, 270° wheels, analog pedals or any other arcade control based on potentiometers.
The built-in audio amplifier circuit is built around an LM386N and the volume can be regulated with a 10K onboard trimmer. You can eventually install a 10K ohm potentiometer instead of the trimmer, and place it in a more accessible position, if you prefer.
Please notice that this amplifier is ok to drive a classic 3 W, 8 ohms speaker, but will fry if you try to amp a lower impedance (i.e. 4 ohms) or higher power (i.e. 5 W) speaker.
Please notice that LM386 are NOT all the same! Buy only amps from thrusted manufacturer or it will likely not work properly (learned the hard way here...).
The audio amp circuit is juiced by the +12V coming from the cabinet power supply on the jamma connector. In case your cabinet is not equipped with a power supply, you can use an external power supply through the dedicated +12V screw terminal. In example, you could use one of the PC's unused power connectors and get the +12V directly from there.
Do not apply external +12V through the screw terminal if you already have +12V coming from the JAMMA harness!!
My prototipe makes +5V and -5V available for external use, in case a power supply is wired to the JAMMA harness. This has almost no real applications and makes the board more prone to failure due to wiring errors than other. This is why I have removed all those screw terminals on the upper side of the board, exept for the +12V necessary for the audio amplification.
In the shared version of the board I also added a safe diode from +12V to ground to protect from inverse polarization.
Whirlwind outperforms Earthshaker from a feature point of view (more inputs, built-in audio amp circuit). It also makes outdated Monsterbash because it features all relevant goodies at a fraction of the (microcontroller) cost.
Whirlwind Gerbers can be downloaded from this repository >>HERE<< (Github).
My projects are free and for everybody. You are anyway welcome if you want to donate some change to help me cover components costs and encourage the development of new projects.
>>HERE<< is my paypal donation page, just in case you want to push the development of new projects ;)
Pinout
All RP2040 microcontroller board GPIOs are hardwired to JAMMA connector as per the attached pinout scheme.
Which GPIOs goes to which JAMMA pad on the connector was selected depending mainly on the phisical location of the pin on the board vs JAMMA fingerboard. The main goal was the reduction, as much as possible, of the PCB vias number.
The pinout is also described in the (verbose) base sketch I wrote (see next step). It must be obviously respected if you want to write a custom sketch compatible with Whirlwind PCB.
Please notice that the microcontroller I am using in this project also has three analog inputs (GP27, GP28 and GP29). These could be used to interface a potentiometer-based racing wheel (also known as 270° wheel), analog pedals or any other analog input a cabinet could ask for.
The three analog inputs are made available through three screw terminals in the bottom of the board. The sketch I wrote do not use them (better: use two of them as digital inputs for players button 6), but it's a matter of simple code modification to make this same interface handle such analog arcade controls.
Code/Sketch
I am firmly convinced that the main feature of DIY PC-to-JAMMA interface boards is the firmware: being open source, you can modify it at your will and have the interface behaviour perfectly tuned to your project.
An open firmware makes any interface more flexible because compromises have not to be adopted a-priori.
I wrote a base sketch to run with Whirlwind. It's functions are:
- Continuous sync frequecy check for video signal amplification enable/disable
- HID emulation: joystick and keyboard
"Joystick and keyboard" emulation means that you can freely assign to each control panel button a specific joypad button or keyboard key. You are not forced to use joypad buttons only or keyboard buttons only: every input is independent from the others.
In the sketch by default all inputs are assigned to joypad inputs. You can assign keyboard keys by defining to each pin a corresponding ASCII value. Values higher than "32" are emulated as keyboard keys, in ASCII format. Values up to "32" are interpreted as joypad buttons.
Sync frequency check is important because low resolution CRT monitors call for a synch frequency of 15KHz circa. Higher frequencies, such those outputted by our PC video cards (31 KHz circa), have the potential to damage the monitor in the long run.
On this regard, please notice that Whirlwind (like any other PC-to-JAMMA interface out there, being them commercial or DIY) doesn't force the videocard output signal to low resolutions! You are in the need for special softwares like CRT Emudrivers. These in turn ask for specific video cards that you can choose from a large list of compatible cards.
Emulating a joystick and keyboard means that the microcontroller, when connected, tells the PC "hello, I am a joystick and a keyboard!". The PC will then start asking the microcontroller at constant intervals if a button is pressed and the microcontroller will start it's love corrispondence :)
The "start" button has a "button shift" function. This means that if you press a control panel button while keeping "start" pressed, the key press emulated will be different to the default key. Assigning those "hidden" keys to specific tasks (exit emulator, open menu, etc) you can have them at your disposal without the need to drill your valuable control panel for more buttons or use unpractical additional keypads.
The start button, given it's "shift" function, triggers the button press on release of the button.
To upload the firmware you must install earlephilhower Arduino Pico core in Arduino IDE first. Core installation and how to upload sketches is described in the link.
The most updated version of Whirlwind's sketch can be downloaded from this repository >>HERE<< (Github).
Soldering Hints
The video amplifier is a surface mount device with 0.65 mm pitch, so I must suggest you to purchase some soldering flux to help solder that microbe. I was used to those cheap "no-clean" Rosing Mildly Activated (RMA) pen with excellent results, but lately I am preferring more dense solder flux.
There are different approaches on how to solder such microbes. For me applying solder to all pads after applying a generous amount of flux, positioning the IC over, re-apply flux and pass the iron over the pads/legs with a clean iron tip works the best. I made a short video-tutorial on how to solder an IC with small pitch: take a look if you are interested ;)
Find the way that works best for you and your gear, but consider to buy at least two video amplifiers such in case one goes bad (in my experience they are very temperature sensible).
A hot air gun is not mandatory and could even be detrimental if you are not used at it.
My suggestion is to solder the video amplifier IC first. You don't want to fully assemble the PCB and then realize the amplifier needs to be reworked or desoldered.
The minimum amount of components needed for a first board test is pictured. As you can see, the whole audio amplification circuit is left out in this stage. The same is true for edge connectors and filter capacitors.
Acknowledgments
Manufacturing of Whilwind's printed circuit board (PCB) was sponsored by JLCPCB, a high-tech manufacturer specialized in the production of high-reliable and cost-effective PCBs.
Their customer service is fast and helpful and PCBs a great value for your money!
By registering at JLCPCB via THIS LINK (affiliated link) you will receive a set of coupons for your orders. Registering costs nothing, so it could be a nice way to give their service a due try ;)
Please, let me stress out that this type of sponsorship is essential to experiment new solutions and share good quality and full working circuits and layouts. It allows testing a first prototype and then share a second (or third, or fourth...), improved and corrected revision of the board. This mechanism has a very positive impact in the quality and reliability of shared projects.
Whirlwind Gerbers and sketches can be downloaded from this repository >>HERE<< (Github).
My projects are free and for everybody. You are anyway welcome if you want to donate some change to help me cover components costs and push the development of new projects.
>>HERE<< is my paypal donation page, just in case ;)