Use a USB gamepad on the MSX using a raspberry pi.

By Vampier

Prophet (2113)

Vampier's picture

08-09-2017, 05:37

I was thinking on how to use a USB gamepad on the MSX and the most obvious answer is: use a raspberry Pi or arduino to translate the input from the USB stick to the DIN ports.

According to the schema only a few GPIO ports are needed

1 2 3 4 5
6 7 8 9

1 FWD - GPIO
2 BACK - GPIO
3 LEFT - GPIO
4 RIGHT - GPIO
5 +5V
6 TRG 1 - GPIO
7 TRG 2 - GPIO
8 OUT
9 GND - To Ground

I'm not that strong in electronics but I assume that the pins I marked with GPIO need to be fed +5V in order to do something with the pin on the MSX?

Just wondering if anyone else has come up with a solution for not being able to find a decent MSX joypad (or are there?)

Also the +5v port could trigger to start 'sequence playback'?

Just a few ideas Smile

Login or register to post comments

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

08-09-2017, 15:11

Do not feed 5v to joystick pins. You need to switch between GPIO Input mode (Button/direction not pressed) and Output, low (Button/direction pressed) Please note that only some Arduinos allow USB-port to be used as USB host controller... Not all. 5v should be enough to feed Arduino & joypad, but I would not power up Raspberry Pi from it.

By sd_snatcher

Prophet (2579)

sd_snatcher's picture

08-09-2017, 15:17

Sadly, connecting 5V logic to the RPi has been a topic for furious flame wars everywhere. There are good articles about this topic here and here.

I would advise to connect it to the MSX joystick port like this:

1 FWD -->|-- GPIO
2 BACK -->|-- GPIO
3 LEFT -->|-- GPIO
4 RIGHT -->|-- GPIO
5 +5V
6 TRG 1 -->|-- GPIO
7 TRG 2 -->|-- GPIO
8 OUT --|<-- 3v3pullup --- GPIO
9 GND - To Ground

-->|-- are BAT85 diodes

This is just a draft, and the connection of the pin-8 would allow you to implement the joyMega protocol to be able to support more than 2 buttons and easy HID detection.

If anyone thinks that he has a better solution, feel free to contribute in a positive way. Please don't start any flame wars about this topic.

I also would advice against trying to power the RPi + USB joystick via the joystick ports. You'll have to use an external power supply instead. Unless you're very sure that the whole setup won't go beyond these limits:

- MSX1 without drive: 100mA
- Low-end MSX2 or MSX1 with drive: 200mA
- High-end MSX2, MSX2+ or TR: 300mA

Note: the real limit for the joystick ports is 50mA. But there's no current limiter on the circuit.

Quote:

Just wondering if anyone else has come up with a solution for not being able to find a decent MSX joypad (or are there?)

IMHO, Sega Megadrive joypads are pretty decent and easy to find for a good price and would save you from a lot of hassle, complex adapters and external power supplies. There are even wireless models. You can easily build yourself one adapter, or buy one ready made from many suppliers like roadfighter.

Quote:

Also the +5v port could trigger to start 'sequence playback'?

I'm not sure what you meant by this.

By Grauw

Enlighted (6272)

Grauw's picture

08-09-2017, 17:38

I was thinking that a bluetooth joystick interface would be nice… I could connect my PS4 controller. However the only 5V BT Arduino I was able to find was discontinued, the rest is 3.3V (though maybe 5V tolerant, don’t know if that’s good enough).

By Vampier

Prophet (2113)

Vampier's picture

13-09-2017, 20:49

My MSX profile