ESPectrum icon indicating copy to clipboard operation
ESPectrum copied to clipboard

PS/2 to Joy shematics

Open soviet9922 opened this issue 10 months ago • 13 comments

Hi looked in the code and documentation but can't find a schematic on how to connect the db9 joystick ports to the ps/2 mouse port.

Where i can find it ?

soviet9922 avatar Apr 24 '24 23:04 soviet9922

Hi, you must use ESPjoy interface from Antonio Villena. https://antoniovillena.com/product/espjoy/ . It simulate keyboard keys press. You also need the green USB to PS/2 adapter.

Gods69 avatar Apr 25 '24 05:04 Gods69

Hi. I join the question, is there an ESPjoy interface diagram somewhere? I don't have the opportunity to buy (I'm in another country), but I could assemble it myself on a breadboard.

Piligrim-77 avatar Apr 25 '24 08:04 Piligrim-77

https://github.com/dacarsoft/DB9_2_Keyboard/tree/DB9_2_Keyboard_ESPectrum You can use a generic ATmega 32U4 boards like Arduino Pro Micro or Arduino Leonardo. Program it with Arduino IDE using "Arduino Leonardo" as board target. And see on the .ino source code the GPIO pins to connect to the DB9 socket.

Gods69 avatar Apr 25 '24 08:04 Gods69

https://github.com/dacarsoft/DB9_2_Keyboard/tree/DB9_2_Keyboard_ESPectrum You can use a generic ATmega 32U4 boards like Arduino Pro Micro or Arduino Leonardo. Program it with Arduino IDE using "Arduino Leonardo" as board target. And see on the .ino source code the GPIO pins to connect to the DB9 socket.

Ok, thank you.

Piligrim-77 avatar Apr 25 '24 09:04 Piligrim-77

Also You must have to use a AVR programmer because you have to program the ATmega chip by this ISP pins.

Gods69 avatar Apr 25 '24 09:04 Gods69

From the ino file this are the pins:

Bluepill ATmega 32U4 board pinout: Arduino 2 -> DB9 pin 1: Up Arduino 3 -> DB9 pin 2: Down Arduino 4 -> DB9 pin 3: Left Arduino 5 -> DB9 pin 4: Right Arduino + -> DB9 pin 5: VCC 5V Arduino 6 -> DB9 pin 6: A / Primary fire Arduino 7 -> DB9 pin 7: Selection signal (allows more buttons) Arduino - -> DB9 pin 8: GND Arduino 8 -> DB9 pin 9: SELECT / Secondary fire

But how you connect the bluepill to the vga32 ps/2 port what pins are used ?

soviet9922 avatar Apr 25 '24 15:04 soviet9922

On the ATmega32U4 compatible card you use the USB socket (micro-usb ?) with a standard USB cable. On the another end you use a little green USB<->PS/2 adapter https://share.temu.com/5SZx1jz1ZpA to the PS/2 ttgo vga32 socket. You must find +5V somewhere to power the 32U4 board.

Gods69 avatar Apr 25 '24 16:04 Gods69

On the ATmega32U4 compatible card you use the USB socket (micro-usb ?) with a standard USB cable. On the another end you use a little green USB<->PS/2 adapter https://share.temu.com/5SZx1jz1ZpA to the PS/2 ttgo vga32 socket. You must find +5V somewhere to power the 32U4 board.

Got it, going to build this thanks !.

soviet9922 avatar Apr 25 '24 18:04 soviet9922

OK. Good luck. Don't forget to swap (uncomment) the define lines on the source code : #define AVILLENA_BOARD //#define BLUEPILL_BOARD 71WZ-QuDE5L AC_SL1500

Gods69 avatar Apr 26 '24 06:04 Gods69

ISP pinouts to program the chip. (you can use a Arduino UNO as AVR programmer) d2b0b6

Gods69 avatar Apr 26 '24 10:04 Gods69

I also have this issue. I think when i have changed to the right board type on the menu the error disappear.Sorry. I'm in Portugal, i can't help until my return.Le 1 mai 2024 20:33, soviet9922 @.***> a écrit : Having some issues compiling the C:\Users\soviet\Documents\Arduino\DB9_2_Keyboard\DB9_2_Keyboard.ino:86:2: error: 'KEY_UP_ARROW' was not declared in this scope {KEY_UP_ARROW, KEY_DOWN_ARROW, KEY_LEFT_ARROW, KEY_RIGHT_ARROW, KEY_RETURN, KEY_RIGHT_ALT, KEY_ESC, KEY_F12, 'z', 'y', 'x', 'm'},

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Gods69 avatar May 02 '24 07:05 Gods69

Thanks all for taking your time for finding and posting this information.

When I have the time, I wish to start a wiki and put together this info and info about many other things.

Regards! ;)

EremusOne avatar May 12 '24 09:05 EremusOne

Program it with Arduino IDE using "Arduino Leonardo" as board target. Somes warnings but compile or use the .HEX file: DB9_2_Keyboard_ESPectrum.zip

Gods69 avatar May 12 '24 19:05 Gods69

ESPjoy interface from Antonio Villena: IMG_20230921_111154050 IMG_20230921_111208911

Gods69 avatar May 17 '24 19:05 Gods69

Here again, finally got the pro micro arduino and from the source code this is the pinout: Bluepill ATmega 32U4 board pinout: Arduino 2 -> DB9 pin 1: Up Arduino 3 -> DB9 pin 2: Down Arduino 4 -> DB9 pin 3: Left Arduino 5 -> DB9 pin 4: Right Arduino + -> DB9 pin 5: VCC 5V Arduino 6 -> DB9 pin 6: A / Primary fire Arduino 7 -> DB9 pin 7: Selection signal (allows more buttons) Arduino - -> DB9 pin 8: GND Arduino 8 -> DB9 pin 9: SELECT / Secondary fire

But there's nothing about the second controller, how can i connect it ?.

soviet9922 avatar Aug 10 '24 22:08 soviet9922

For the second joystick DB9 is:

Bluepill ATmega 32U4 board pinout: Arduino 10 -> DB9 pin 1: Up Arduino 16 -> DB9 pin 2: Down Arduino 14 -> DB9 pin 3: Left Arduino 15 -> DB9 pin 4: Right Arduino + -> DB9 pin 5: VCC 5V Arduino 18 -> DB9 pin 6: A / Primary fire Arduino 19 -> DB9 pin 7: Selection signal (allows more buttons) Arduino - -> DB9 pin 8: GND Arduino 20 -> DB9 pin 9: SELECT / Secondary fire

Gods69 avatar Aug 11 '24 07:08 Gods69

Hi!

Hash6iron, one of our users, has created a fork of ESPjoy firmware with all the info for building your own adapter. He called it "PowaJoy" :)

Here's the url: https://github.com/hash6iron/DB9_2_Keyboard_ESPectrum

Regards ;)

EremusOne avatar Aug 11 '24 08:08 EremusOne

It's me again xD Asking things, now programed the arduino pro micro from the IDE and it works when i connect it to my pc using USB the joysticks ports work great and get the keys output when moving them.

The issue is that using the usb ps/2 converter can't get it to do anything, the lights turn on the arduino. When i move the joystick but there's no output on screen.

Tested this in the vga32 but also nothing using ps/2 already enabled the second keyboard from the menu. Tried several cables and adapters but seems not to be the issue.

Is like the arduino only works on USB mode.

Thanks !.

soviet9922 avatar Aug 13 '24 00:08 soviet9922

The arduino with its Atmega_328p only simulates a PS/2 keyboard. It does not have a USB mode, for that you have to use the ATmega32u4. The small green USB<-->PS/2 converters do not have any electronics inside. The computer or keyboard must be able to work in PS/2 mode.

Gods69 avatar Aug 13 '24 08:08 Gods69