News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Gx4000 wireless adaptor for gamepads

Started by Liartes, 11:14, 19 February 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liartes


Hello,


I have been searching recently about DB9 wireless adaptor for Gx4000. 8bitDo does not seem to support Gx4000, so I will probably make my own.
Gx4000 DB9 port does not provide power and I will not take the risk to fry the hardware so I was thinking about a very simple circuit with NPN transistors replacing the physical switches of the gamepad.
Then I would use a Arduino to pilot the transistors and simulate the gamepad. The Gx4000 should works just as usual, right ?


Since it will need an external power supply with arduino, I am thinking about and adaptator that fit both the DB9 port at the same time and sat in front of the Gx4000, as simulating joystick 2 does not bring more complexity to the project.


Now for the emitter, I would like to keep the original gamepads, and branch them onto some sort of box. This box would host a Arduino, power supply and transmite gamepad inputs through radio frequency.


Do you know if a similar project already exists ? Any advice would be greatly appreciate !

Sid_

Sounds very good and will be interested by this project.

Bryce

Consider using a 74LS240 to drive the inputs instead of NPN transistors as it will reduce your BOM count, PCB size and the amount of soldering you need to do. You can see how to implement this in the AMX mouse schematic: http://www.cpcwiki.eu/index.php/PS2Mouse

Bryce.

Liartes

Hi Bryce,


Thanks for your advice. The AMX mouse schematic is a great help for understanding how to use 74LS240 chip.

Bryce

It has the advantage that it is synchronised with the COM pulses (COM isn't permanently low or a ground connection) which avoids key clashes. It can also be driven directly from the µP (or an Arduino output in your case) without the need for current limiting resistors etc that a transistor would require.

Bryce.

Liartes

Bryce,


I totally lack the knowledge on the COM pulses, I though switches of the gamepad were open circuit, and closing the circuit triggered an input.


So with the 74LS240, which is a NOT octal buffer, every PINs connected to the DB9 port will be set to HIGH signal when nothing is pressed, right ?
Then when a button is simulated, a PIN will change to LOW signal.


the synchronisation with the COM pulses is acquired with the wiring VCC (resistor) COM, PIN 10E + PIN 20E ?


And this is the combination of COM at LOW signal with another PIN at LOW that simulate a "button pressed" instruction ?

Bryce

No, not quite:


The 74LS240 is a buffer, but what's important is that it is Tri-state.That means that the outputs are neither high nor low unless the chips output enable pins are low. If it was a normal buffer, the outputs would always be putting out whatever the inputs were reading.

The reason this is required is because the COM pin is only going low when the joystick is being scanned (software controlled). If the 240 was always outputting highs or lows it would cause ghost keypresses (ie: the console would think that certain keyboard keys are being pressed although the GX4000 doesn't have a keyboard). When COM goes low, the 240 outputs the states of the joystick, but outputs nothing (High-Z) when the COM line goes back high.

The joystick contacts are open circuit, but connect COM to the inputs, not a permanent ground to an input.

Bryce.

Liartes

I think I understand the chip layout now. 2 lines of 4 input-output, each with it own enable pin.


Thanks you again Bryce ! It will greatly simplify the job on the "Arduino to DB9" part of my project :)

Liartes

Hi again,
Here is a first wiring schema for the receiver part. There is enough IO pins on the Arduino nano to wire the joysticks, the RF receiver and even two LED stating if input are received for each gamepad.I ordered some materials for this project, I will do a prototype next month.



Bryce

Nice artwork, but have you considered downloading KiCAD or Eagle? :)

Bryce.

Liartes

I tried briefly KiCAD, I will need a few hours of training before producing a similar schema. What is the advantage of using it over the pen, paper and eraser method ?

Bryce

The main advantages are that you can change it as often as you need without it turning into a page of tipex and crossed out lines. It will also do the ERC (Electrical Rule Check) for you and when you decide you want to make a PCB, it will transfer the design to the layout editor where you can create the PCB traces etc. On top of this, it also avoids you making pinout or footprint mistakes.


Bryce.

Liartes

I will definitely give it another try then, I do not intend on making a PCB but I love the idea.


Something worry me with the AMX mouse schematic exemple. In my case, aren't resistors necessary to protect the DB9 inputs ?


An arduino will power out a HIGH signal at 5v, 40mA current on a pin, and this signal will be turned into a low 2v signal by the 74SL240... @ 40mA maybe, I need to test this, but maybe it is a bit strong ?

Bryce

40mA is what the pin CAN deliver. What actually flows will be decided by the CPC circuitry, so no resistors are required.

Bryce.

Liartes

It has been a long time, but I managed to source almost everything I need to start prototyping. Here is the receiver part wired for Joystick 1
https://zupimages.net/up/20/30/sths.jpg
Prototype plugged in, Batman running endlessly to the right as expected  :P
https://zupimages.net/up/20/30/8n28.jpg
Now I'm waiting for prototyping boards or a second breadboard in order to mount the emitter part and experiment with RF transmission.

Powered by SMFPacks Menu Editor Mod