Archive for April 2014

Converting old Game-port joysticks to USB

This project intend to revive old PC Game port type joysticks by converting them to modern USB HID game device.

So, you want to convert your good old Suncom F15 Talon joystick from this:

OldCon

into this:

NewCon

In this post I will explain in detail how to convert an old Game Port joystick to USB using pic microcontroller. I will also provide PCB schematics and PIC firmware.

Note: This project requires basic electronics understanding and soldering skills, And of course, everything provided here is given as-is, use it wisely and on your own risk.

This project is intended to replace the hardware of a Suncom f15 Talon joystick, but with little tweaks can be used for other types of joysticks. The PCB have several extra inputs to accommodate for extra inputs/axis.

Suncom F15 Talon joystick

The SFT joystick, aside from Game-port connector, have a keyboard bypass connector that enables the joystick to convert joystick buttons into keystrokes. This function was necessary since PC Game-port supports only 4 buttons. It has a programmable feature to set what key is mapped to which button. This function is now obsolete since a USB joystick can support as many buttons as needed. The joystick itself contains 2 PCBs inside, one at the base that controls all programmable functions and keyboard emulation, and another one inside the grip that collects all button presses and communicate them with the base PCB. I had to reverse engineer this communication since the communication chip was too old to find a datasheet for. Turns out its a simple parallel to serial converter, easily handled by a microcontroller. This also eliminate the need to replace the PCB in the grip.

Dismantling the SFT base PCB

We now need to carefully remove the base PCB taking notes of some wiring connections.

Open the base: remove the suction cups by unscrewing them. Reveal the base screws by pealing off the rubber pads. Unscrew the base screws and remove the metal base.

Remove the PCB: Unscrew the 5 PCB holding screws. Lift the PCB. Using a soldering iron start removing all wires from the PCB. There are 4 wires connecting the pots, and 9 wires connecting the grip. 5 of the wires coming from the grip must be carefully noted and marked before disconnection: GND, PR, CS, D0-D1, and Pi-P/S

bottom_pcb_note

Note and mark these wires!

The other 4 wires coming from the grip are the original game port buttons and we don’t need them. (There is a button in the grip just under the POV lever, that selects if the 4 main buttons will be send using the com chip or using the 4 direct wires. By default its on, so we do not need the direct button wiring)

Salvage necessary components: Some parts are needed to be salvaged from the main PCB, to be used on the replacement one. Carefully remove the 4 tact buttons, the slider switch and the 5 LEDs. (these parts are rather standard, so they can be replaced with new ones if needed)

Further preparations: The original game-port used only 2 wires per potentiometer it used a very unreliable method to measure the pots state. The new PCB used DA converters to detect POT state. For this we need 3 wire per pot – VCC, GND, and return. Applying VCC and GND to the POT ends, gives a voltage on the return pin that is relative to the POT dial position. Add an extra wire to each POT as in the following photo, and take note of the pin names:

pot_conn

Potentiometer connections


Replacement PCB

The new PCB I designed is based on Microchip’s PIC18F25K50. All other components are just capacitors/resistors and the salvaged parts. Here are all the files you need in order to make this PCB yourself:

Schematics:  SuncomF15
Kicad Project: SuncomF15KicadProj
Gerber files: gerbers_suncomf15_5by10_Green_HASL_1.6mm
Part list: Suncom_F15_BOM

Feel free to use/change/distribute these files. There are no restrictions whatsoever.

The simplest way to have this PCB is to get it manufactured on line. For merely 15$ you can get 10 pieces using this fine website:  IteadStudio. Just select and buy the “2Layer Green PCB 5cm x 10cm Max“, note the order #, and send them an email with the Gerber zip file attached. (see detailed instructions on the product page).

PCB Assembling

After obtaining the parts and PCB you will need to assemble it. The PCB is 2 layered with components on both sides. First you should assemble the PIC, the programming connector, and all capacitors and resistors. Then on the other side, assemble LEDs and switches. Then connect all the wires.

Assembling PIC and res/caps: This stage is mostly SMD soldering. If you are not familiar with it, there are a lot of tutorials on Youtube. Its not that difficult. Start with the PIC, then resistors/capacitors, then solder the JST programming connector.

Assy_step1

Assembling SMD components

Assembling the Switches: First assemble the tact buttons. Make sure they are fully inserted into the PCB:

Assembling tact switches

Assembling tact switches

Next you need to solder the slide switch. The PCB I designed have no space for the switch mounting holes, so you will have to Cut/file the mounting legs out:

Cutting slide switch mounting pins

Cutting slide switch mounting pins

Then solder it to the PCB, direction is irrelevant, it is symmetric.

Assembling the LEDs: The LEDs are a bit tricky to solder since they have to be mounted in a certain height to fit the led holes in the plastic base correctly. Any method can be used but here is how I did it. First I placed a piece of  tape over the holes of the LEDs from the outside:

Placing a tape over the holes of the LEDs

Then I inserted the LEDs into the PCB without soldering them. Next, I carefully turned the PCB over and placed it inside the base in the correct location, using the screw holes as guides. I then let the LED fall into place. The tape will prevent them from falling too low. And if you use a clear tape, you can make sure the LEDs indeed fell into place correctly. I then put 2 screws to hold the PCB, and solder the LEDs inside the plastic base. Take extra care as not to damage the plastic with the soldering iron.

Placing the PCB and letting the LEDs fall into place.

Placing the PCB and letting the LEDs fall into place.

Connecting a USB cable: You will need a USB cable for this. Either salvage it from an old unused USB device, or just get a USB2 extension cable from EBAY and cut the female edge. You will also need to salvage the rubber gasket at the entry of the cable into the base, from the old cable. Just cut the old cable from both sides of the gasket and remove the inner wires from it. Then, insert the cut side of the USB cable through the gasket, making sure it is from the correct side:

Passing the USB cable inside the gasket

Passing the USB cable inside the gasket

Next, Solder the cable to the PCB from the switch side. The cable should be color coded, if not, you will have to figure out each wire functionality.
Connect green wire to D+
Connect white wire to D-
Connect red wire to the square pad
Connect the black wire to the last pad

USB cable wire connections

USB cable wire connections

PCB completed with LEDs switches and cable

PCB completed with LEDs switches and cable

Connecting grip wires: Its time to connect the 5 grip wires. They should be connected based on the markings made in the “Removing PCB” section. I have added wire colors based on my own joystick, but I can not guaranty its the same for all.

Connect CS wire (Dark blue) to CK pad
Connect Pi-P/S wire (Brown) to ST pad
Connect D0-D1 wire (Gray) to DA pad
Connect PR wire (Red) to the square pad on the bottom left
Connect GND wire (Black) to the bottom right pad

assy_grip

Connecting the 5 wires of the grip

Connecting the potentiometers: We now connect the potentiometers to the analog inputs. Connect x axis pot to the A1 analog input and the y axis pot to A2.

assy_pots

Connecting the potentiometers

Note: Make sure the potentiometers wires are long enough, if not, you must replace or extend them.

Wrapping up: That’s it! The hardware part is finished. All is left is to fix the PCB into the base. Place back the red button cups with their spring in place. Align the slider switch hat with the slider switch itself. Carefully place the PCB into its place aligning the switches with the cups. Fasten the 3 screws to hold the PCB in its place. Press the red buttons and move the slider switch to make sure all is working mechanically.

Placing red cups and aligning the slide switch

Placing red cups and aligning the slide switch

Lastly, Fit the rubber cable gasket in its place.

PCB is fasten in place. Rubber gasket is fit.

PCB is fasten in place. Rubber gasket is fit.


 

Software

The software for the PIC is based ob Microchip’s HID game device demo. I have adjusted it to fit specifically for the Suncom F15 Talon. For other joysticks you will have to tweak the SW accordingly. It shouldn’t be that hard. A feature I added in my version is that when the slide-switch is on (LED is lit), the base buttons become toggle buttons. When the switch is off, they are momentary.

Download the project from this link: SuncomUsbJoystick_PIC18F25K20

The project can be compiled with Microchip MPLAB IDE 8.56 and up. If no tweaks are needed, just use the hex file available in the above zip. You will have to make an adapter cable from PicKit/ICD to JST. Just connect pins 1 – 5 of the programmer to pins 1 – 5 of the JST connector. Pin 6 is unused. Here is an example programming cable for pickit 3:

pic_cable

PicKit 3 programming cable

Thats it!


 

An optional mechanical tweak

This step is optional, but I find this tweak as a very nice improvement to the Suncom joystick.  The Suncom have a 4 way POV. The POV input comprises of 4 tact switches for north, south, east and west directions. Theoretically, by detection of two switches pressed together, it is possible to add the sub-directions as well: north-east, north-west, south-east, and south-west. However, the Joystick mechanically prevents it. Here is a way to overcome this mechanical limitation. Caution:  do this tweak carefully as you might mechanically damage the stick.

For this part, you will have to take apart the joystick’s grip. First, pull out the 2 4-way controls cups. Then unscrew the grip screws and carefully separate the 3 plastic pieces comprising the grip. After opening the grip, remove the 2 screws holding the grip’s PCB, and remove the PCB. During this process, springs and button cups may fall, so be careful not to loose anything. Now take a look at the POV base (The POV is the right 4-way control). There is a concave indentation with 4 pins from 4 sides. These pins limit the POV stick movement. Cut about 2 mm from their height to remove this limitation:

pov_tweak1

Cutting the limit pins

Next, we address the POV stick itself. We need to add some thickness to the stick plate. We do it by adding a layer of isolation tape to the bottom side of the plate:

pov_trweak2

Adding a layer of tape

Lastly we need to address the cover. The opening in the grip plastic for the POV stick is “+” shaped to make place for 4-way movement. You will need to file it to make way for the 4 other directions. I used a small round file to add slits for the “X” directions:

pov_tweak3

Filing the “X” directions.

Voila! You have an 8 directions POV now. You might need fine tune these changes if it does not work at the first try.


 

Good luck, and if you have questions, feel free to leave a comment.

-SHS