Jump to content
IGNORED

PlayStation 1 (PSX) Controller Schematic - Help Needed


HeadcolorsTV

Recommended Posts

Maybe someone can help me solve a few small problems I'm coming across. I'm following this schematic/description -- https://gamesx.com/controldata/psxcont/psxcont.htm#CIRCUIT


I think I figured it out...mostly. He leaves a lot to be deciphered, lol. I'm drawing up a schematic in KiCAD right now, and I only have a few questions:

1. The DATA pin of the controller plug connects to SER OUT, correct?

2. Where does the COMMAND pin of the controller plug connect to? I must've re-read the entire page 15 times and still can't decipher where COMMAND goes.

3. Are the 74HC165 pins not associated with buttons (A1-A8, B1-B8, etc.) left with no connection? Or do they share a connection? COMMAND, maybe? 

Thanks in advance!

Link to comment
Share on other sites

The schematic shown in your link is not complete - it only shows 2 of the 5 74HC165 shifters needed.

 

It looks quite complicated to interface Sony Playstation controllers.

 

If you want to use Playstation controllers for Playstation emulation, this can be done thru RetroPie using the GPIO module https://retropie.org.uk/docs/GPIO-Modules/

 

 

Link to comment
Share on other sites

3 hours ago, Forrest said:

The schematic shown in your link is not complete - it only shows 2 of the 5 74HC165 shifters needed.

 

It looks quite complicated to interface Sony Playstation controllers.

Which is why it took me a good bit of time to decipher what he was drawing up. I'm posting my version of the schematic. Other than H2 (COMMAND) and the NC pins of the 74HC165 chips, I'm pretty confident that this is what he was going for (I had to decipher what he meant by "1/4A, 2/4A, 1/4B," etc., and also read up on the data protocol to figure out that A-H of each HC165 === Bit 7 to Bit 0, and the first HC165 === Byte 01, etc.).

3 hours ago, Forrest said:

If you want to use Playstation controllers for Playstation emulation, this can be done thru RetroPie using the GPIO module https://retropie.org.uk/docs/GPIO-Modules/

Nope. :) I want to design a brand new PCB for brand new PSX controllers that'll work on Playstation 1s.

 

Eeschema__HC-SX010.png

Link to comment
Share on other sites

I am not sure why anyone would want to build a controller when you can just purchase them but that aside I think you may have a few errors you should double check on....

I may be wrong but I think there may be a few errors…

 

1) You appear to have Left direction going to U5 when it should be going to U4, you are also missing the L3 & R3 buttons to U4.  The order should be SLCT, L3, R3, Start, U, R, D, L connected sequentially from direction L at input A to SLCT at input H as the SPI bus is LSB first. If you are not interested L3 & R3 then tie those pins to VCC, never leave input pins floating.

 

2) For U5 you have the inputs connected in the correct order but not to the correct pins, L2 goes to input H instead of input G, and square goes to input A not SER. Any serial data clocked into U5 should never reach the output so just tie SER to VCC.

If I am correct about the above then your button data will be out of sequence and the Square button will never work

 

3) For U1 tie inputs A-G to VCC, you could tie them to GND as the first byte it is junk data and ignored by the PlayStation.

 

4) For U2 to tell the PlayStation it is a Digital controller you need to send it $41 so tie the A – H inputs as follows…

A – GND

B - VCC

C - GND

D - GND

E - GND

F - GND

G - GND

H – VCC

 

For U3 to tell the PlayStation it is ready to send data you need to send it $5A so tie the A – H inputs as follows…

A – GND

B - VCC

C - GND

D - VCC

E - VCC

F - GND

G - VCC

H – GND

 

This is a dum controller design in that in unlike a design with a microcontroller it cannot understand commands sent to it from the PlayStation and is just relying on the ATT line to switch between Parallel data loading of '165's (button data read) and serial shift. When in shift mode it relies on the SPI clock to shift the data & put it onto the bus.

Consequently you should not need to connect Command as it serves no purpose in this design.

 

Link to comment
Share on other sites

4 hours ago, Stephen Moss said:

I am not sure why anyone would want to build a controller when you can just purchase them

Because I'm actually not purchasing them; I'm selling them. Arcade controllers, to be specific.

4 hours ago, Stephen Moss said:

You appear to have Left direction going to U5 when it should be going to U4, you are also missing the L3 & R3 buttons to U4.  

...

Any serial data clocked into U5 should never reach the output so just tie SER to VCC.

If I am correct about the above then your button data will be out of sequence and the Square button will never work.

As NFG points out in his abridged schematic and description: "NB E8 is SER IN on the last HC165".

 

And this is a first-model PlayStation1 (digital) controller. DualShock sticks didn't even exist at launch, let alone L3 & R3 buttons.

4 hours ago, Stephen Moss said:

This is a dum controller design in that in unlike a design with a microcontroller it cannot understand commands sent to it from the PlayStation and is just relying on the ATT line to switch between Parallel data loading of '165's (button data read) and serial shift.

And if microcontrollers were a cost-effective alternative, I'd probably be going with those. But for now, I'll stick with the "dum" design. :D

4 hours ago, Stephen Moss said:

Consequently you should not need to connect Command as it serves no purpose in this design.

Thank you. I've reached out to other people, and have gotten the same answer, so that's what I'll go with for now. Once the ICs come in the mail, I'll slap it all on the breadboards.

Link to comment
Share on other sites

On 6/27/2019 at 4:37 PM, HeadcolorsTV said:

As NFG points out in his abridged schematic and description: "NB E8 is SER IN on the last HC165".

What does that even mean? 

As far as I know the command codes and controller protocols are the same for all PlayStation controllers, or at least for Ps1 and Ps2 the only real difference being the extra analogue data and rumble motor commands. E8 is not a valid controller code that I am aware of so it it part of some magical byte that has 9 bits instead of the normal 8? I might accept a 9 bit byte if the last bit was parity or a stop bit but as its value is entirely arbitrary depending on if the [] button was pressed it would be useless for either of those functions. 

 

If you look at his information immediately above where is says "PSX Controller Data" in bold you will notice two things about the timing diagrams...

First there are only 5 bytes of data, When ATT is high those 5 bytes are loaded into U1 to U5, E8 would be part of a sixth byte so what purpose does it serve?

Second if you look at bytes 4 & 5 the bits are numbered 0 to 7 as one would expect, where is E8 for your [] button and as part of a sixth byte how will it ever be clocked out or read?

Equally, if you look immediately below that point it also shows only 5 bytes.

 

The only way we will know for certain if Mr McCubbin or myself is correct is when you build it.

On 6/27/2019 at 4:37 PM, HeadcolorsTV said:

And if microcontrollers were a cost-effective alternative, I'd probably be going with those. But for now, I'll stick with the "dum" design. :D

Actually they are not that expensive, Mouser do a 28 pin 18F24K20 for $2.08. With an internal clock there is no need for a crystal so there is probably little price difference between that and the logic chips, plus you save space making the PCB cheaper. You would need to buy a PICkit programmer to dump your code into the microcontroller but at about $50 but if you make enough units (or mark-up) the price of that is negligible, assuming you can write the microcontroller code.

Run at 64MHz it was just fast enough to simulate the controller interface from the PlayStation to read a DualShock controller including full access to mode select and motor control which is much more complicated so it should be fast enough for what you want to do.

 

Link to comment
Share on other sites

On 6/29/2019 at 8:48 AM, Stephen Moss said:

 

The only way we will know for certain if Mr McCubbin or myself is correct is when you build it.

 

 

So far, it looks like neither of you were. ? 

 

I was able to finish putting the schematic together (pic attached), thanks to everyone's help. However, it's still not working. No response from any button input whatsoever.

 

The only thing that gave me anything was when I was fooling around on the breadboard, trying different connections, and removed the connection from pin 17 of U6 (the 74HC240). Playing Twisted Metal 2, in the title menu, the cursor just started endlessly going to the right (about 4 times per second). Reconnecting doesn't stop it, but oddly enough, when I do that and then insert CMD IN between pins 16 and 17, the cursor movement will stop at random for about half a second, and button presses (any of them) will sometimes freeze the cursor; holding the button will not keep it still, however, and no button will advance me past the title menu.

 

And so I tried re-doing the connections for the 5 sets of A-H, based on what you advised, Stephen. Zip. Zilch. Can't even get the pin 17 disconnection to glitch the inputs. I also tried tying A-H of U1 all low. Still nothing.

 

By the way: is pulling up the highs in U1 - U3 even necessary, or should I just go directly to 5V on the highs? OR should I also be pulling down the lows with resistors?

HC-SX010_7_4_2019.png

Link to comment
Share on other sites

3 hours ago, HeadcolorsTV said:

 

HC-SX010_7_4_2019.png

Yes, I did notice my schematic has the binary for U2 & U3 incorrect. I have corrected it to be:

[U2] 0100 0001 (LHLLLLLH)

[U3] 0101 1010 (LHLHHLHL)

 

Still the same result, using both Stephen's and NFG's starting points (U1/G vs U1/H). Not even a remote sign of it working.

 

I've tested all my breadboard rails and other important points, and everything tests fine. I even tried swapping in a fresh HC240. I really want to get this to work, and I know it must have, because it did in 1998.

Link to comment
Share on other sites

You do not have to use pull up or down resistors on fixed state inputs, it should not affect operation if you do, personally I just connect them directly to VCC & GND as applicable.

 

You say you have corrected the logic state for U2 & U3 are the indicated new states...

[U2] 0100 0001 (LHLLLLLH) 

[U3] 0101 1010 (LHLHHLHL)

written in the same orientation as the pins in your circuit diagram (H to A) when read from left to right?

 

If so then you have then you have the states for U2 back to front and are sending a controller ID of 82 which the PlayStation would no recognise and so probably terminate communications, try changing U2 to 1000 0010 (HLLLLHL) and see if that makes a difference (see post 4 above for pin by pin connection listing).

 

If that still does not work and you have space on your bread board then making a logic probe like this may help you solve the problem, any 2 input NOR will do and just change the resistors to 330 Ohm for a 5V supply.

 

Alternatively, put an LED and 300 Ohm resistor between ground and the the QH pin of U1 (Data out) and then replace the CLK and ATT outputs of U6 with a 330 - 1K Ohm pull up resistor to VCC and either a switch or piece of wire (to short to ground) and manually load / clock the shift registers to check that the correct data is being shifted out. If so that would then isolate the problem to U6. 

  

 

  • Like 1
Link to comment
Share on other sites

I see in the schematic you posted that R1 is 1k but the schematic from the website in your first post has it at 22k. What is it on your breadboard? Just for grins, double check the orientation of D1. As stated before, manually clocking bits as a sanity check is a good idea.

 

How old is your breadboard? It's possible that the connectors in the breadboard have been stretched out. I received some second hand breadboards once and it took me a while to figure out that was the problem.

  • Like 1
Link to comment
Share on other sites

35 minutes ago, emerson said:

I see in the schematic you posted that R1 is 1k but the schematic from the website in your first post has it at 22k. What is it on your breadboard? Just for grins, double check the orientation of D1. As stated before, manually clocking bits as a sanity check is a good idea.

 

How old is your breadboard? It's possible that the connectors in the breadboard have been stretched out. I received some second hand breadboards once and it took me a while to figure out that was the problem.

Ah yes, R1 is 22K. I overlooked that one in the schematic and forgot to label it properly. I also noticed in NFG's schematic that his R2 is labeled "1K0". Not sure if that was a typo, I tried a 10K resistor. As expected, this didn't fix the problem.

 

My breadboards are fairly new, but I'm never buying Elegoo brand again. "Amazon's Choice"...my ****. On a previous controller circuit I was testing, one of the voltage/ground rail pairs was shorting into itself right out of the box. Turned on my console and heard such a pleasant feedback hum as a result. ? 

 

Do you (or does anyone here) have a recommendation for an "old reliable" breadboard they'd swear by?

Link to comment
Share on other sites

4 hours ago, Stephen Moss said:

You do not have to use pull up or down resistors on fixed state inputs, it should not affect operation if you do, personally I just connect them directly to VCC & GND as applicable.

 

You say you have corrected the logic state for U2 & U3 are the indicated new states...

[U2] 0100 0001 (LHLLLLLH) 

[U3] 0101 1010 (LHLHHLHL)

written in the same orientation as the pins in your circuit diagram (H to A) when read from left to right?

 

If so then you have then you have the states for U2 back to front and are sending a controller ID of 82 which the PlayStation would no recognise and so probably terminate communications, try changing U2 to 1000 0010 (HLLLLHL) and see if that makes a difference (see post 4 above for pin by pin connection listing).

 

If that still does not work and you have space on your bread board then making a logic probe like this may help you solve the problem, any 2 input NOR will do and just change the resistors to 330 Ohm for a 5V supply.

 

Alternatively, put an LED and 300 Ohm resistor between ground and the the QH pin of U1 (Data out) and then replace the CLK and ATT outputs of U6 with a 330 - 1K Ohm pull up resistor to VCC and either a switch or piece of wire (to short to ground) and manually load / clock the shift registers to check that the correct data is being shifted out. If so that would then isolate the problem to U6. 

  

 

So A1-A8, B1-B8, etc. should each go from A to H, as opposed to H-to-A as NFG put in his schematic? If so...yes I've tried that too. ?

 

I'll have to pull an LED out of my scrap collection and give your logic test a go. Otherwise I'll have to wait for a NOR gate chip to come in from Mouser, and I really don't feel like spending $7.99 for shipping on just one chip. Thanks very much for the tips! I'll let you know of my results in a little while.

Link to comment
Share on other sites

I got this one from school and it's served me well. All my other ones are second hand. https://www.mouser.com/ProductDetail/Twin-Industries/TW-E41-102B?qs=TqtMe0HCz7eOhjhxDJC55w%3D%3D

 

It's been my experience that notation like 1k0 is using the k as a decimal place. For example, something like 1k2 is really saying 1.2k

 

There are many ways to make a basic logic probe. Try typing "simple logic probe" into google images and see what comes up. You should be able to make one of those.

Link to comment
Share on other sites

On 7/5/2019 at 2:10 PM, HeadcolorsTV said:

So A1-A8, B1-B8, etc. should each go from A to H, as opposed to H-to-A as NFG put in his schematic? If so...yes I've tried that too. ?

Bits are clocked out of the 74HC164 in the order H-A, the PlayStation SPI bus is Least Significant Bit (LSB) first so for a data byte B7 (MSB) to B0 (LSB), B0 goes to H and B7 goes to A so that is is clocked out LSB first.

 

You don't need a NOR gate for the logic probe, you could just use the resistors & LED's but having an isolating logic gate is a good idea, a couple of NOT gates or an AND with both inputs tied together would work just as well.  

Link to comment
Share on other sites

On 7/5/2019 at 4:26 AM, Stephen Moss said:

Alternatively, put an LED and 300 Ohm resistor between ground and the the QH pin of U1 (Data out) and then replace the CLK and ATT outputs of U6 with a 330 - 1K Ohm pull up resistor to VCC and either a switch or piece of wire (to short to ground) and manually load / clock the shift registers to check that the correct data is being shifted out. If so that would then isolate the problem to U6. 

 

Trying this method, let me make sure I got this right:

 

When it's hooked up as described, the LED lights up.

 

LED STAYS lit = 0 ?

LED turns OFF = 1 ?

 

In any event, I'm trying different breadboards. Not really expecting much from these, as they're also Elegoo, just unopened. I'll probably order better quality ones this coming weekend. The ones I was using were so touchy that even getting my fingertip near parts of the circuit caused the LED to go out, and all the wires I'm using are insulated. ? 

Link to comment
Share on other sites

Welp, I'm stumped. 

 

Testing the logic on U1-U3, everything's fine. This is with A1 starting at U1/H or U1/G. I get:

 

1111 1111

HGFE DCBA

 

1000 0010

HGFE DCBA

 

0101 1010

HGFE DCBA

 

(1 = LED goes from ON to OFF)

(0 = LED stays ON)

 

And still, the controller isn't recognized. I swapped U6 with a new one, same result. I tried new breadboards, same result.

 

The problem must be somewhere in my understanding of the U6 schematic. Can anyone point out where I'm going wrong? One of the gates (pin 1 (GND) or 19 (ATT))? Is my data-out on U1 pin 9 connected to the correct pin on U6 (pin 6)? After that, I feel like I've run out of questions to ask.

Link to comment
Share on other sites

The data looks correct, I am not sure where you have put your LED but I would have placed it between either QH (9) pin of U1 or the 2Y1 (5) pin of U6 and Ground so that 1 = On.

I wonder if the ACK signal is the problem I will see if I can simulate the circuit as I think the CR times may not be correct but it may take a few days as Proteus is a pain in the ass.

 

 

Link to comment
Share on other sites

You are in fact using HC devices and not LS or some other ttl logic chip correct? The playstation may not like ttl level signals even if your circuit if working perfectly.

 

When doing the manual test, place one LED on the QH output of U1 and a second LED on the DATA line of the controller port. An LED on 1Y0 of U6 won't hurt either to monitor the clock bus. ATT at the controller port should be pulsed high to lock the status of all '165 inputs. Use a resistor to hold ATT low and pulse high. Manually send clock pulses on the CLK input of the controller port. Use a resistor to hold CLK high this time and pulse low.

 

Double check that CLK INH of all '165s are grounded. Also, you should tie any unused inputs to either VCC or GND. I'm looking at pins 11 and 13 of U6.

Link to comment
Share on other sites

I simulated the circuit per your most recent schematic plus my instructions from before and received the following bits at the DATA output of the controller port. The ACK line seems to go low when ATT is asserted, and pulses with the clock. Otherwise it remains high.

 

1111 1111
1000 0010
1010 0101

 

 

ps1_controller.png

Link to comment
Share on other sites

Okay, so I got it working!

 

...and I'm still not 100% sure why, exactly.

 

I just gave myself a crash-course in Fritzing so that I can post a breadboard illustration of how I have it set up. 

 

Three things:

  1. I was a dummy and swapped R1 (22K) with a 1K, just to see if it made a difference, but forgot to swap it back to the 22K. Once I did that, I saw the thing I'd been looking for: that beautiful purple arrow cursor in the PS1 console menu.
  2. It turns out that NFG's method of starting at U1/G and ending with the Square button at U5/SER was CORRECT. Go figure.
  3. The problem was, the purple cursor would often flicker away or disappear completely. I spent a good two hours trying to find where the weak connection was, nearly at the pulling-my-hair-out point. I tried about three different diodes and five different 22k resistors. I touched and lightly wiggled nearly every wire. It got to the point where I was pretty sure it was one of the buses. And then it happened: I pulled the bus-to-bus 5V wire out to disconnect the 5V bus on the ABCD side (see illustration), happened to look up to see a solid purple cursor. Confused, I started testing the buttons. Flawless. Started a game of Twisted Metal 2. Everything worked perfectly.

So I'm sure this makes sense, I just don't know exactly how (maybe someone can enlighten me?). In any event, assuming this isn't a case of me lucking into a working circuit by getting something very wrong, I have a working controller. If it's good, then great. I can throw the schematic into KiCAD, get this fabbed, and give 'er a whirl. THANK YOU, everyone who helped out. I feel like I had a tidal wave of knowledge crash into my brain these past two weeks, and I somehow retained all of it.

 

Untitled Sketch_bb.png

Edited by HeadcolorsTV
breadboard image was incorrect; had to update it and re-upload
Link to comment
Share on other sites

It looks like you removed VCC from most of your chips. They shouldn't work without power, and the fact that your circuit works now is concerning with most of your chips not powered correctly. It's possible they're receiving parasitic power through the pull-up resistors at the inputs. I suggest fixing this before getting pcbs made.

Link to comment
Share on other sites

1 hour ago, emerson said:

It looks like you removed VCC from most of your chips. They shouldn't work without power, and the fact that your circuit works now is concerning with most of your chips not powered correctly.

I agree.

 

Perhaps it is just an omission in the breadboard layout image but I noticed that there is no link at the centre of the power rails. Maybe it is not required on your by breadboard as I cannot see how anything would have worked otherwise but most breadboards I have come across the all the power rail holes on the left and right halves are connected together but the left and right each halves are not connected together- might be something worth checking if you don't already know they are linked.

 

I managed to simulate it in Protues, as far as I could see the data being clocked out was fine, but the ACK pulse wasn't. With the original 22K for R1 the required clock speed was too fast for C1 to discharge low enough to produce a pulse, reducing the clock speed by a factor of 10 did allow it to discharge enough to produce a horrid looking pulse that was all over and undershoot.

Not sure how helpful that is as it depends on how much faith your put in circuit simulators. Personally, I find digital simulation is good but analogue is utterly wrong (at least they always indicate none of my perfectly good circuits work).  

Link to comment
Share on other sites

8 hours ago, Stephen Moss said:

Perhaps it is just an omission in the breadboard layout image but I noticed that there is no link at the centre of the power rails. Maybe it is not required on your by breadboard as I cannot see how anything would have worked otherwise but most breadboards I have come across the all the power rail holes on the left and right halves are connected together but the left and right each halves are not connected together- might be something worth checking if you don't already know they are linked.

I only have the pull-ups and the "missing

pulse detector" on the second half, so I thought it was ok to get the 5v from the originating bus; I think I connected the center ground rails because I was ruling out a fairy rail at some point. Gotta love these breadboards.... :| 

 

Would this be the cause? Am I overloading the two voltage rails? 

8 hours ago, Stephen Moss said:

With the original 22K for R1 the required clock speed was too fast for C1 to discharge low enough to produce a pulse, reducing the clock speed by a factor of 10 did allow it to discharge enough to produce a horrid looking pulse that was all over and undershoot.

 

That R1 was a weird part of the issue I was having. Before discovering my odd "solution" (and therefore with the two voltage rails still connected), I noticed while fiddling with R1, the purple cursor returned in a weak, flickering way when my fingers were touching both leads.

 

I'm gonna try connecting the center rails, as well as the "bad" rail, and form a closed loop on the other sides of each. I get the feeling that I'm not getting enough juice to every component and the circuit is prioritizing.

Link to comment
Share on other sites

1 hour ago, HeadcolorsTV said:

I'm gonna try connecting the center rails, as well as the "bad" rail, and form a closed loop on the other sides of each. I get the feeling that I'm not getting enough juice to every component and the circuit is prioritizing.

Lo and behold: I was actually onto something here.

 

Connecting the main rails to both the outer and other center rails, then connecting the 5V rails to each other at both ends worked, BUT ONLY if I only connect voltage at the main and outer rails at both ends, while leaving the two center voltage rails connected only at the far end (see updated breadboard diagram). Again, the controller went from a very bad/flickering ATT to a perfectly working controller; was able to play TM2 for about 20 minutes straight without a problem.

 

I'm not quite able to put my finger on it, but might it be something involving the relationship between the 5V going to U6/pin20 and the 5V going to C1? 

Untitled Sketch_bb.png

Link to comment
Share on other sites

It seems like you may have VCC and GND wires crossed somewhere. Have you measured the voltage across every chip when the circuit is not working? Try putting jumper wires where I put the purple ones here. This is standard for most every breadboard I've come across.

 

Edit: It can be a real pain, but if you can assemble your breadboard circuits neat and tidy like in these pictures, it really helps with troubleshooting when things aren't working right.

 

breadboard.png

Edited by emerson
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...