I finally sat down the other night to interface the joystick. The joystick uses 4 wires. Namely they are 5vdc, Gnd, Shift/Load and Clock. The Clock line is also wired to Q out via current limit resistor. This effectively transforms the clock line input an I/O. The operation is pretty strait forward here. Send a pulse on the Shift/Latch wire to latch the key data and the clock and read. Every clock cycle also has a read cycle. When the clock reaches the positive level the I/O Pin of the MCU is changed to read mode. A small delay is used to ensure no noise it sampled. After this the pin is read, since the clock line is an input, and the Q pin is output passed through a current limit. We can clock and read the same pin at the expense of some additional current flowing through the Q data pin and the MCU output pin.
With a stable theory of operation i began to write a driver on the ATtiny2313. This did not take long at all. While testing the driver i thought i had found a bug. I was not getting direct powers of 2 for each button. I double and triple checked my code. I could not find anything to explain these results within my code base. At this point i started to suspect a problem with the hardware. So i held various buttons down in parallel and made mental notes of the make and break codes. At some point i discovered a bit position which masked another bit position - regardless of make and break status. Almost as if this bit had priority over the other bit.
The circuit in the joy stick uses active pull up resistor networks. I suspected that one of the networks may be bad. After testing the circuit i found that all the resistor networks were good and all solder joints were good. There were no mechanical problems either. The only thing left is a very well hidden bug or the SN74HC165 is defective.
Looking at my code once again i still could not find anything that would cause this problem. I looked in my lab for some spare chips, but i have none. Since i don't have any, and i am writing the driver i should probably buy some for future use. At this point i still have not found a problem with the code. I will order the chips in a few days. I'm not sure how much will be done before i get the new chips. I like to work things one step at a time.
This is a high speed Cmos device which are known to be static sensitive. I did not observe precautions during the disassembly or testing of the device. I also carried the device across the room in my home which has carpet. It is very likely that i damaged the device.