SukkoPera / PsxNewLib

Playstation controller interface library for Arduino
GNU General Public License v3.0
130 stars 28 forks source link

Generic controller not working #20

Open eduardri opened 2 years ago

eduardri commented 2 years ago

I have 2 different kind generic controllers (made in china), one of them work perfect, but the other kind don't work with PSXNwelib. I try withe library PS2X_lib and the control work, switch to PsxNewLib and stop to work, the leds on the receiver blink and looks like no binding with the controller

DUMP_COMMS: <-- 01 42 00 --> FF FF FF <-- 01 42 00 --> FF FF FF <-- 01 42 00 --> FF FF FF <-- 01 42 00 --> FF FF FF <-- 01 42 00 --> FF FF FF <-- 01 42 00 --> FF FF FF

could you help with this issue?

SukkoPera commented 2 years ago

Hard to say without more info: What are you using to do the level shifting? What pullups are you using? How are you generating the 3.3V?

eduardri commented 2 years ago

I'm using arduino nano, to supply the 3.3v direct form the borad, arduino is connected to usb, no resistor connected to the receiver, i read about using 10k resistors but not difference. if i Connect "brand a" is working, switch to "brand b" not working both brands work if i change to old PS2X_lib.

what test do i need to do?

SukkoPera commented 2 years ago

This makes me realize I need to improve the wiring instructions.

  1. You MUST do some kind of level-shifting if you are using an Arduino working at 5V, as the controller works at 3.3V. There are various techniques for this, I usually use the bidirectional shifters based on the BSS138 MOSFET, they work well in this case.

  2. You MUST add pull-up resistors on the DAT, CMD and CLK lines. In the future one on ACK will be required too. The level-shifting technique I suggested above already includes them, but if you are using a different technique, or if you are using an Arduino board that works at 3.3V, you will need to add these pull-ups externally. They MUST be 1k.

  3. All of the above is implemented on my PsxControllerShield.

I'm sorry but I really cannot support users of this library that do not connect controllers the right way to begin with.