Close

Making the keyboard emulation work

A project log for Wolf

Use a Jaguar or SNES controller as a joystick and a keypad in Atari 2600 and 7800

danjovicdanjovic 03/28/2022 at 00:230 Comments

Another debugging session, this time to make the keyboard emulation work. Found a software bug, a pin swapping and a short circuit.

## The software bug was an incorrect logic operation. I wanted to isolate the column bits and used the 'and' operation instead of the 'or'. That caused all the COL pins to get grounded, being interpreted like all keys being pressed at the same time


## The pin swap was causing the keys 123 being swapped with the keys 345. I have swapped the order of the rows  1 and 2.
This one was fixed by software, just swapping the constants on the switch() inside the interrupt routine.

## The last one was causing the first row of keys  ( 1 4 7 * ) to never be actuated. I first checked all the code and macros and nothing seemed to be causing such behaviour. Then I disconnected the circuit board from the videogame and shortcircuited the pins 5 and 4 to check the wiring was ok. Then I measured the continuity from Arduino pin A0 to the resistor R6 and it was ok. Finally I have measured the continuity from pin A0 to GND and found a short circuit close to the left pad of R6

And here is the keyboard emulation working


Discussions