arduino-psx-controller icon indicating copy to clipboard operation
arduino-psx-controller copied to clipboard

Add joystick support

Open veroxzik opened this issue 1 year ago • 5 comments

Placeholder issue for discussion - not actively being worked on by me.

veroxzik avatar Aug 30 '24 19:08 veroxzik

@djsedaw Please switch to this issue for discussion.

Hi, all going well, one question, do you think the micro has enough pins for 4 d-pad buttons, 4 on the right, start and select, L1 and L2, R1 and R2, L3 and R3 which are the buttons on the 2 joysticks, plus the 4 pins for the spi?

Micro has 20 I/O pins, but MISO/MOSI/SCK/SS are not included in this count. D-pad (4) + Face buttons (4) + Start/Select (2) + L1/2 (2) + R1/2 (2) + L3/R3 (2) = 16 digital pins Left/Right Joystick = 4 analog pins However, we need one additional line for the PS-specific ACK line.

So unfortunately, it looks like we are exactly 1 pin short.

I was looking at the raspberry pi Pico board which has enough pins but only 3 analog pins, which means I would need a ADS1115 to increase the analog pins Sorry 5 pins for the spi

If you're going with Pi Pico, this library is largely useless, since it's tailored to the 32U4.

veroxzik avatar Aug 30 '24 19:08 veroxzik

That's what I thought, 1 pin to far, do you think it's possible to port the library to the Pico? Will have a try!

djsedaw avatar Aug 31 '24 11:08 djsedaw

As I mentioned, basically none of this code is applicable to the RP2040, because it directly manipulates AVR registers.

You are better off looking at an existing RP2040 project; here's one example: https://github.com/TonyMacDonald1995/DS4toPS2

veroxzik avatar Sep 03 '24 03:09 veroxzik

Maybe an option to add a PCF8575 i2c pin extender

eolvera85 avatar Sep 09 '24 23:09 eolvera85

hi, Pico code writing going weil, thought i had better make sure the cable works, but try it using your library, have connected it to the micro as per your instructions but it does not move the menus, have checked that the buttons work, checked the wires on the ps2 cable, but not working, powering it by the 3.3v, should the Rx light be on all the time?

djsedaw avatar Sep 16 '24 17:09 djsedaw