Playstation controller interface?

BotB

Member
Hi, I'm doing an animatronic creature and for laughts I thought it'd be good to controll the animatronics via a Playstation (1 or 2) controller or an old NES Advantage Arcade pad... I use the PICAXE 28X1 board and have used it before to make an animatronic head (See attached Image)

I've done a little research on the PS2 controller (or PSX as they seem to be reffered to) and I've found that it's not so straight forward, it doesn't have the simple in and outputs I'd like... I'm not very electronics literate so the link below may help you understand...

http://www.gamesx.com/controldata/psxcont/psxcont.htm

I'm sure that even though the NES Advantage controller is older and therefore simpler in design it will still not be so straight forward...

I was wondering if there is any way to program the PICAXE 28X1 to decode the Playstation controller and use it as an input device?

The NES Advantage seems prety straight forward and shouldn't be so hard to hook up to the PICAXE inputs so I'll worry about that if there's no hope for the PS controller...

I have put my own buttons and that into an older Playstation controller with success but surely it'd be more fun to be able to plug any old playstation 2 controller into the PICAXE right? :D .

Many thanks and please ask for any more details, I will do my best to answer them.
 

Attachments

hippy

Ex-Staff (retired)
It may be possible to use a PICAXE to decode the PSX controller and use it as an input device though whether that's better than ripping the innards out and using your own buttons within a controller as you have done is an interesting question.

Without looking at it in depth, it seems the protocol would be possible to generate and decode, though it may require a fair bit of code overhead to achieve that and a bit of fiddling to get it right. It may actually be simpler and easier than a quick glance leads one to believe. Perhaps the most work is in understanding what it is doing, working out how to do it, and then getting it to work. If you have a scope or logic analyser that may prove useful.

The NES controller seems a much simpler proposition as it appears to only be a shift register; send a latching pulse and the state of eight buttons is captured, send eight clocking pulses and each is put out in turn. It may be possible to handle that with a simple PULSOUT and SPIIN.
 

BotB

Member
Thanks a lot for the reply, I'm pushed towards the NES controller (for nostalgia reasons) but I'm a little lost still as what to do with it, I'll talk to an Electronics teacher at University tomorrow and show him the controller. I'll report an any good feedback. I'm sure it'll be easyer to explain and understand when it's right in front of us.

Luckily the NES Advantage doesn't have any in build chips so I can assume that it's outputs are somewhat simpler.
 

unigamer

Member
This may not work for you at all but just an idea. You can wire each joystick up as two potentiometers. I've done this before. The buttons as switches on the inputs. Basically get rid of the circuits inside the controller and just wire the input devices directly to the Picaxe.
 

alband

Senior Member
I'd go with unigamer.

The inputs they use in the controllers are dead easy to hack and, the devices themselves are very easy to get into and close up. Some of them even have a seperate connector that connects all the buttons to the main gubbins, so they just need that re-wiring - I'm currently doing a PS2 controller mod this way, and I have done one in the past.


There is one hitch though, which is a 28X1 wont work because the PS2 controller has 15 buttons and 4 potentiometers (2 per joystick). The 28X2 doesn't have enough inputs. The 28X2 doesn't have enough inputs for this. I'd recommend the 28X2 which has enough inouts for almost anything and is still fairly small. Also, if you've already got some kind of circuit set up, it will directly replace a 28X1.

Good luck! :)
 

BotB

Member
Well invariably the number of buttons is an issue, but I intended to use only those I felt suited.

Also I've already used your mention of using the "thumb stick" as inputs for PWM and an extra button... In the end I can always make a "box" controller from a Maplins box like I have done before but this whole thread is about pushing it that little bit further...
 

Andrew Cowan

Senior Member
Have you thought about using the old controller as the box? Strip out their electronics, and replace it with something easier to use, like a 14m.

A
 

hippy

Ex-Staff (retired)
I think we shouldn't get too carried away with alternatives - valid though they are - as both NES and PSX interfacing is very likely possible. It's just a question of how much effort needs to be put in. A quick glance at the NES spec says "easy" to me, PSX needs a bit more thinking about but seems "entirely doable".
 

Wrenow

Senior Member
Be aware that http://www.lynxmotion.com/Product.aspx?productID=73&CategoryID=46
has a PS2 breakout cable, if that helps you - as well as a lot of information on coding it for microcontrollers. Also, CheapControSystems, as linked earlier, works with PS2 and gives you 6 channels.

And, for what it is worth, http://www.strikemodels.com/ is working on a Zigbee based ship control system that is planned to have at least 3 ESCs (one unidirectional, two bidirectional) and a slew of programmed servos operated by an Xbox/PS type controller (custom-made, and including a 360 degree controller knob). It has been in design and shakedown for a couple of years, and has reached public demo or the prototypes phase and, from what I understand, is in final pre-production stages. Its purpose is to provide coordinated and converging fire from multiple turrets on a model warship, some with different rates of fire and with different arcs of engagement. Basically, you dial in the target's position relative to the ship, and set the target's approximate range, and all guns that can come to bear on the target do so. When you hit the fire button, only the guns on target fire, and, if you hold the fire button down, continue to fire at their allowed rate (if the target designator moves to a position that others engage and some are disengaged, the firing adapts). This is relatively complex behaviour, and is elegantly handled. Pretty nifty system. It should be fairly programmable, but exactly how programmable for the end-user is unknown as yet. I would think he would make it pretty open to expand his sales beyond the Model Warship Combat market into animatronics and robotics and Model Tank Combat markets (some guys in regular hobby RC cars, boats, etc. might also like something with 16-20 control channels).

Sadly, Nomadio, which was working on a 36 channel controller with feedback cghannels as well, has dropped the hobby market to concentrate on military applications.

I will, of course, be happy to post further information when it becomes available.

Cheers,

Wreno
 
Last edited:

D n T

Senior Member
Play station controllers rock

I found that the after market Playstation controllers actually appear better suited to modification. If you have a close look you will see that the joysticks are mounted seperately and are connected to the main board with ribbon cable, if you de solder the cable you can solder in your own leads, the circuit is fairly easy to trace.
The main board with the buttons , if you follow the tracks you might notice that each track from the button pad to the black blob which is the microcontroller brain, has a 3mm contact on the board. Just cut the track after the dot and solder in you own lead to you 28X. R1,R2, L1, L2 are also connected with ribbon cable so connecting to them is easy.
I did find that it is a good idea to get the dreml out and get nasty on the board though, it is a good idea to cut a ring around the controller to isolate it completely, because we all know Murphy.

If you go hard you can make the controller remote, stick a 433mhz module in it and transmit you signals, I think I have seen a playstation that does already.
17 digital, 4 analog controls 3 brand new units for 20.00AUS at a local gaming store. At that price you can stuff one or twwo up and use them as spares.
You should have a go at it just because you can.
 

BotB

Member
Thanks for all the help and links so far...

I've been looking at the NES controller option, would it be possible to link the relevant pinouts from the controller to the picaxe and use a "serin" command to read the controllers "clock" signal?
 

hippy

Ex-Staff (retired)
SERIN won't work but it should be easy enough to use HSPI or the 'SHIFTIN' routines described in Manual 2.
 

BotB

Member
Hey thanks alot hippy, the SHIFTIN routines look promising, I'm a little though as to where the SPI in and out is on the PICAXE 28 X1 board. I've checked the manuals but there's no clear indication of what pins are for the SPI in and out.
 

hippy

Ex-Staff (retired)
I agree with tjetson. For PICAXE which have hardware SPI ( and the same applies to hardware I2C and high-speed serial ), it is always a good idea to use the pins which would be used by hardware even if using a bit-banged solution. That makes it so much easier to move to using the hardware support if one wishes to later.
 

hippy

Ex-Staff (retired)
True, they are default inputs on the 28X1, but being on Port C they can also be used as outputs. It means having to use only "HIGH PORTC" and "LOW PORTC" to do the bit-banging, but it shouldn't be too much hassle doing that.
 
Top