Hey there.
I’ve succesfully connected a PSX controller to my robot. When I bought a wireless controller i found that it was a PS2 controller. It doesn’t work. Just to see what would happen if i used a regular wired PS2 controller i noticed it did work, but so much slower. So far, i know both (psx and ps2) controllers work the same, so… i can’t figure out what’s wrong.
The PSX wired controller that works great is some generic brand i doubt anyone outside my country would know. The PS2 wired controller that works reeeeally slow is Sony, the one that came with my PS2 console. The wireless controller that is not working is intec.
I’ve made my codes out of several sites. One of them is “manual” with a lot of loops and the other one uses “shiftin/shifout”. Results are the same. I’m working with a Microchip 16F84A PIC and I’ve tried speeding up the program and slowing it down. The generic controller always works grate, the sony ps2 slower and the wireless doesn´t work at all.
I’m only experienced using the Basic Atom and Basic Atom Pro. I have no experience with the pic chip you are using. Sorry… I can tell you that there should be no difference in speed between any of the controllers.
The 16F84A PIC is fairly slow. The Atom BASIC chips use a 16F877 as the base.
Are you using a crystal, resonator, or an internal R/C oscillator? What clock speed?
Are you writing your program in BASIC, C or asm?
I see no reason for the WIRED PS2 controller to run slower. I hope you don’t plan to run a 'bot with the same 'F84 chip. Little room, and not much power! Perhaps you’re just running the PS2, and sending the received data to another processor. I’ve been considering doing that.
Well, my goal is to use the controller for a car-like robot. I hope I will use both y-axis analog values and a couple of digital buttons. I never used a PS controller like this, so I’m using the 16F84 for the tests. If the problem is solved and I can use the wireless controller I will move up to a PIC with more ports (I’m not a huge fan of serial communications).
I’m using Basic for programming the PIC. I’m also using a 4MHz crystal. As I said, I have two programs, I use the “Shiftin/Shiftout†clock in one of them (inverse clock between PIC and controller) and the other one has 24us pauses between rise and fall of clock. Somewhere I read PS2 controller was faster, so I changed the crystal for a 12MHz. Guess what?… the PSX controller still works great and the PS2 controller doesn’t work at all.
No matter how many modifications I have made to the speed of the clock, PSX controller works just fine and the PS2 controller works slow (have to keep pressed the button for a while to notice changes and then the signal keeps up after it is released) that is, if it still works.
I have to mention the wireless controller; the receiver keeps searching for the device and never stops blinking.
I’ve read that PS2 Command Set by Nathan Scherdin and some codes here at lynxmotion that use them… I have to say that’s completely new to me. I didn`t have to do that stuff before…
Do you think that’s the reason my PS2 controllers won’t work well? Can somebody explain briefly what are those codes used for? I didn´t understand all of them.
OK, that’s a place to start. I am a little bit surprised that the 16F84 at 4 MHz can do it under BASIC. I may have to try that chip under C, and use it to convert. However I’d probably use a chip with I2C.
Interesting that the PSX controller still works at the faster speed. But then I suspect that you have a clock frequency command in BASIC, and it might correct. An SPI slave simply runs at the speed of the master, anyway, if I remember correctly.
Don’t worry. Thanks for your help.
And by the way… I didn’t use the clock frequency command because I didn’t want the compiler to compensate it. I was testing if the controllers worked that way.
I used the “Set mode and fix” code. I set it as analog and locked the analog button. The setup worked for the PSX controller but not for the PS2 one, but we have an important thing here… the PS2 controller doesn’t work slow by using this! The bad news is that the wireless controller doesn´t work.
I guess the simplest answer was the right one all along. My wireless controller doesn´t work for this. I have to get a new one and hope it will work. I found a list of controllers that are known to work with this kind of application so I’ll try to get one.