Tuesday, September 30, 2008

Problems with joy stick electronics


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.

1 comment:

Артур Борис  said...

I’m Артур Борис a resident/citizen of the Republic Of Russian. I’m 52 years of age, an entrepreneur/businessman. I once had difficulties in financing my project/business, if not for a good friend of mine who introduced me to Mr Benjamin Lee to get a loan worth $250,000 USD from his company. When I contacted them it took just five working days to get my loan process done and transferred to my account. Even with a bad credit history, they still offer their service to you. They also offer all kinds of loan such as business loans, home loans, personal loans, car loans. I don’t know how to thank them for what they have done for me but God will reward them according to his riches in glory. If you need an urgent financial assistance contact them today via email  247officedept@gmail.com  WhatsApp information...+1-989-394-3740