Author Topic: Gx4000 wireless adaptor for gamepads  (Read 384 times)

0 Members and 1 Guest are viewing this topic.

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Gx4000 wireless adaptor for gamepads
« on: 12:14, 19 February 20 »

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 !

Offline Sid_

  • CPC464
  • **
  • Posts: 37
  • Country: fr
  • Liked: 37
  • Likes Given: 41
Re: Gx4000 wireless adaptor for gamepads
« Reply #1 on: 12:24, 19 February 20 »
Sounds very good and will be interested by this project.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.337
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4017
  • Likes Given: 419
Re: Gx4000 wireless adaptor for gamepads
« Reply #2 on: 12:29, 19 February 20 »
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.

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Re: Gx4000 wireless adaptor for gamepads
« Reply #3 on: 14:09, 19 February 20 »
Hi Bryce,


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

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.337
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4017
  • Likes Given: 419
Re: Gx4000 wireless adaptor for gamepads
« Reply #4 on: 14:24, 19 February 20 »
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.

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Re: Gx4000 wireless adaptor for gamepads
« Reply #5 on: 15:07, 19 February 20 »
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 ?

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.337
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4017
  • Likes Given: 419
Re: Gx4000 wireless adaptor for gamepads
« Reply #6 on: 15:34, 19 February 20 »
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.

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Re: Gx4000 wireless adaptor for gamepads
« Reply #7 on: 16:36, 19 February 20 »
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 :)

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Re: Gx4000 wireless adaptor for gamepads
« Reply #8 on: 13:28, 23 February 20 »
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.



Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.337
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4017
  • Likes Given: 419
Re: Gx4000 wireless adaptor for gamepads
« Reply #9 on: 13:30, 23 February 20 »
Nice artwork, but have you considered downloading KiCAD or Eagle? :)

Bryce.

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Re: Gx4000 wireless adaptor for gamepads
« Reply #10 on: 17:54, 23 February 20 »
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 ?

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.337
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4017
  • Likes Given: 419
Re: Gx4000 wireless adaptor for gamepads
« Reply #11 on: 09:47, 24 February 20 »
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.

Offline Liartes

  • CPC464
  • **
  • Posts: 7
  • Country: fr
  • Liked: 3
  • Likes Given: 1
Re: Gx4000 wireless adaptor for gamepads
« Reply #12 on: 15:10, 25 February 20 »
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 ?

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.337
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4017
  • Likes Given: 419
Re: Gx4000 wireless adaptor for gamepads
« Reply #13 on: 10:30, 26 February 20 »
40mA is what the pin CAN deliver. What actually flows will be decided by the CPC circuitry, so no resistors are required.

Bryce.