I've got some really good news, and I've also got some kind-of bad news. We'll get the good news out of the way first.
The PS2 protocol has given me fits for the last few days but I finally got it figured out. What was happening was that the first two commands to the controller returned the expected data. However, the third byte read from the controller was coming in as 0xDA instead of 0x5A. At first I thought I had found a bug in OBsIV's code, and that this was the reason why some adapters recognized the XIM and other's didn't. Given the order of the comands that I'm issuing to the controller, the return value of 0x5A is kind of useless and can be ignored. However, after telling the adapter to ignore that data, it became quite obvious that my timing was off somewhere. I did a little more looking around, and found the answer. When changing the states of the lines to and from the PS2 controller, you're supposed to give the signals time to settle before moving on to the next command. A 1 micro second delay is plenty of time. As it turns out, I had delayed everywhere I needed to except for one place. That delay in made all the difference.
Now for the bad news. My wife has my computer that has AVR studio on it, and my P.O.S. Vista machine won't recognize my STK500. If I can get the chip burned, I'll be able to post a video later tonight. Otherwise, it'll be tomorrow before I can show everything working.
Stay tuned, kiddies! The best is yet to come!
No comments:
Post a Comment