Thursday, August 28, 2008

PS2 Controller no worky

Well, last session I got the code into the MCU and got the receiver attached to the MCU. However, I could not get the receiver to respond to my SPI requests at all. A bunch of the session time was spent diagnosing what I was transmitting however. I had the bit order wrong. I was going at the maximum 500Khz which probably wasn't so good on a bread-board with all it's capacitance. I had a code path which didn't manage the slave select properly.

I was able to see all this on Tom's nifty LogicPort usb analyzer. Oh, yea, it took a while to figure out how that software worked too.

However, I worked through all those issues and got what I was transmitting to look pretty good before the session was over. However, still no replies.

I have two things I want to investigate next time:
  1. I am mixing 3.3V and 5V tech here. Now, the logic analyzer was set to 1.5V logic so I would have seen any response from the PS2 controller on the LogicPort even if the MCU didn't see it. However, the notes I'm reading say only some of the PS2 controllers are good at 5V whereas others won't work at all. I need to suck it up and slap down the transistors I need to do the voltage conversion properly. I should also look into using the ATmega48/88/168 which will run at 3.3V no problem. However, the code is setup for the ATmega32 core at the moment and it will take less time to plop down the transistors than switch the code to the newer cores.
  2. One odd bit I noticed about the slave select: it selects long before it sends any data. In fact about half the time the the device is selected, no data is sent at all. Most of that time is before any data is sent. I'm not sure what my code is doing to cause such a delay but I should look into the issue against the possiblity that being selected so long with out data angers the reciever.

Wednesday, August 13, 2008

PS2 Controller


Going to try to start blogging regularly again. I think its a good habit. Anyway, I'm working on my Robomagellan again. Towards that project I've been working on communicating with a regular Sony PS2 wireless controller.

When I got the controller I decided that I did not want to bust out the receiver from its plastic case and solder to the connections inside directly. I found a place that sells repair parts for the PS2 console and bought a controller/memory card socket module for $20. There were two controller receptacles in the module and a circuit board. I de-soldered the circuit board and sawed the module in half netting me two sockets. The socket you see above has had junk desktop computer wires soldered back to it and all plugged into a long pin length 0.1" header to make it compatible with a ordinary solderless breadboard. I'll use this to debug the controller interface software I've written. The socket I will eventually mount on to my own custom circuit board for integration with my robot.