PJ – Troubleshooting Controls

Overview:

On the PJ JAMMA adapter board, a joystick event is detected when the indicator LED stops flashing and stays on. The LED should stay solid when a D-Pad or Button is pressed.

If the LED continues to flash and is not staying ON when a button is held, the PJ board is not detecting the button press. Check your wiring. If wiring is ok, check and if found faulty, replace the four, 74165 ICs on the PJ board.

When the PJ board first starts up, and before the linux communication drivers are loaded, the LED will flash quickly, off and on approximately every half second.

Once the drivers are loaded and successful communication is estabilished with the Raspberry PI , the flashing will slow down to approximately once per second.

If the speed of the LED flashing doesn’t change after Linux fully boots, please check that the drivers are loaded. If loaded, either the GPIO on the Pi, or the MSP430 microcontroller on the PJ board may be faulty.

Check to logs in /var/log/debug

Reading the state of the joystick, button and switch controls:

The driver module pjjoy provides standard joystick interface devices for use in Linux. The best way to troubleshoot these controls it to use the joystick test utility jstest against device driver files /dev/input/js0 (player 1) and /dev/input/js1 (player 2). These device files will not be present unless j4b and pjjoy modules are loaded (in that order).

To monitor the state of the controls run:

sudo jstest /dev/input/js0 (or js1)

You should get something that resembles what is below:

Driver version is 2.1.0.
Joystick (PJ 2-axis 12-button digital controls) has 2 axes (X, Y)
and 12 buttons (BtnSelect, BtnStart, BtnMode, Btn1, Btn2, Btn3, Btn4, Btn5, Btn6, Btn7, Btn8, ExtraBtn).
Testing ... (interrupt to exit)
Axes:  0:     0  1:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off

Simulating joystick events using the keyboard:

It’s possible to insert joystick and button events using joytest utility. This can be used for troubleshooting the driver and emulation configuration by passing the controller hardware on the PJ.

Compile the utility:

cd /home/pi/utilities/joytest/
make clean
make

Run the joytest utility as follows:

cd /home/pi/utilities/joytest
sudo ./joytest /dev/j4binput0

The utility should display the following control options. Either player 1 or player 2 controls can be tested by selecting the appropriate joystick device (/dev/j4binput0 or /dev/j4binput1).

Using queue: /dev/j4binput0
Press ~ to quit
Use W,S,A,D for UP,DOWN,LEFT,RIGHT
Use I,O,P,J,K,L for BUTTON 1,2,3,4,5,6
Use Z,X,C,V for SELECT,START,EXTRA,MODE
ch = 0032 ' ', val = 0000, msg = 8.0.0.0, wrote = 1
Press "~" to quit the utility.