Jump to content
IGNORED

Using PSX or SNES controller on other consoles cheaply


Uzumaki

Recommended Posts

For those who are not familar with Arduino or ATMega328 that I am using, this Wiki should help you understand. Original source of hardware, libraries, programming guides, and forum for programming the chip to help and troubleshooting is arduino.cc

 

Now to my project!

 

 

I have a test working showing output from PSX (digital controller) to LEDs. I also did the same for SNES but decided to keep working on PSX as the older models are friendly with 5v. Some Sony branded anaolog (DS1) controllers and many PS2 (including DS2) are temperamental and would have a hard time working on 5v, and I'd have to build level shifter to get 3.3v controller to work with consoles that uses 5v for controllers. Extra parts = more work, more chance of something not working :P

 

The video shows the direction, 4 action buttons, and start button working. It'd correspond to Lynx direction, A, B, Option 1 and 2, and pause. Select, L1, L2, R1, and R2 is available for other controllers that needs it. I also have the sketch for SNES controller (2 less shoulder buttons) for use on other consoles but it's still bugged and needs time to fix.

 

I planned to add this into Atari Lynx to replace the built in controller. This project can also be adapted to use with other consoles although most of them uses negative logic (0 when pressed, 5v when not pressed) so the codes would have to be modified to have inverted output. It's as simple as adding an ! to every output so it'd go low when it's true, else go high.

 

Some consoles like SMS, 2600 and 7800 would be easy to wire straight in. Genesis would require shifting to get ABC and Start button working. 6 button's XYZ is a whole another can of worm I am not touching. I don't know about Saturn yet, and only nerd or idiot would use this to connect PSX controller to... PSX!!! XBox probably won't work well without 2 analog sticks, which the library currently doesn't support.

 

NES, SNES, and Virtualboy can be handled with a regular off the shelf parallel to serial shift register chip. Intellivision uses 16 directions and would suffer from reduced accuracy in some games like Vectron plus you'd need to add keypad. Colecovision also needs keypad but is doable as well.

 

Atari 5200 could work as digital only controller with all buttons but no keypad either.

 

A chip ATMega328 is about $5, plus extra for wires, connectors, and you could probably figure out the rest if you can find the pinout and know how controller is read on console side. You'd need something to program though, an Uno board with DIP chip will work. That is, not the SMD version of Uno. A clone can be found for as little as $15 on eBay while genuine Arduino can run around $30, which goes toward helping those Italian developer make more revisions, improvements, and other versions.

 

The Arduino I was using in the video is Nano version, ideal for breadboard experiment as it has onboard USB for on the spot reprogramming but it's about $15 for the clone. I plan to use a stand alone $5 chip in final form.

 

Attached is the sketch plus library. The original source of the library is http://playground.arduino.cc/Main/PSXLibrary but I had to tweak it a bit so I'm including the modified library.

 

PS yes LED in the video were bright. 3mm LED + 1k resistor on 5v is still dang bright!

Psx.zip

Edited by Uzumaki
Link to comment
Share on other sites

Minor change, added one option for Lynx as some games you have Lynx in vertical position. The code uses select button to change the controller to match Lynx so you don't have to hold PSX controller sideway for a "tall" game.

 

Also added some comment in the file for easier editing in the future. You still need the library I attached in the previous post.

 

Next: I'll start wiring Lynx to this mod and see if it works.

psx_lynx_rotate.zip

Link to comment
Share on other sites

Aaaaaaand it work!!!!

 

http://youtu.be/-gunWWGjPUc

(video ready at about 10:30 pm when u;loading is done)

 

Playing Blue Lightning with PSX controller.

 

I still need to fine tune the wiring, shrink the project smaller, and mount the controller port on Lynx itself.

 

The button assignment I have set (can be changed with code or rewiring) is

X is button A

square is button b

triangle is option 2

circle is option 1

start is pause.

 

180° flip and reset from controller works the same as on Lynx.

 

Looking at the schematic while I was wiring it up, I did notice a minor design issue: a short can occur if you press the button on Lynx while not using PSX button. I haven't figured how to make the chip float output instead of pulling to low. When it's pulled to low (no button pressed), and you press Lynx button the same line is pulled high and either the chip would burn out or Lynx would crash.

 

I don't want to add any more component (9 separate tri-state type buffer for each of the 9 lines) and of the chip does not support tri-state output I may have to modify the front panel and snip away all but the on/off/backlight/power LED to prevent accidents. It'd suit me fine as this system is going to end up consolized anyway when I get hold of the TV out board from candle.

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

Minor tweak to my circuit. Moved the power pin for PSX controller to Arduino's 3.3v out. Added a 10k pullup to data in, and a few other resistors for cheap level shifting. Newer PSOne controller now works fine in digital mode (analog LED on controller not lit). And since it's running on 3.3v, there shouldn't be any risk of burned out controller.

Link to comment
Share on other sites

great project!

 

Do you know if Arduino could support 19 input pins and 8 output pins?

 

Example: Arcade type controller that has, up, down, left, right, button 1,2,3, and 3x4 keypad all using common ground switching. Inputs are floating or pulled high.

 

Then based on these inputs being pressed (made low) generate an 8 line matrix code?

 

See truth table here:

http://web.archive.o...h/intvcont.html

 

Plan right now is to use hardware to do this, but this forces me to use solid state relays (or at least this is the plan right now) as I want to use common ground SPST (arcade type buttons) and have them force multiple contacts to close when a single button is pressed.

 

It could be done with gates too, see here

 

http://web.archive.o...intvsticky.html

 

The only sticking point for me using the info at the URL is that button 3 would require both buttons to be pressed vs. having a 3rd button, which the project I'm trying to make would have.

 

edit: 3x4 could be changed to matrix to reduce pin count to 7, but that still leaves 4 directions and 3 input buttons, so 14 inputs and 8 outputs. for total of 22. Atmega328 seems to support 20 or less.

 

 

thanks

Edited by grips03
Link to comment
Share on other sites

Most Arduino has 13 digital I/O and 6 analog (which can be made to behave like digital) so standard stuff won't work. You'd need to try the mega which can do over 50 digital I/O You can look up Mega 2560 which is the current standard board. There's also Due but it only works at 3.3v and may not work for Intellivision.

 

The controller you are using, it sounds like it uses positive logic? Pulled high when pressed, low when not pressed?

 

I've already made a beta code to connect Jaguar (6 rows x 4 colums matrix, 10 pins needed) to Intellivision (8 pins) but I haven't tested it yet. I wanted to use Jaguar controller because it has everything except for 16 direction but not all games benefit from full 16 directions anyhow. Plus Jaguar controller has pause button, which I could use to simulate pressing 1 and 9 on the keypad.

 

I did mine more or less after reading http://www94.pair.com/jsoper/jag_adapter.html but the original design required redonkulous number of logic chips, diodes, and oscilloscope to set up initial timing. The resulting box is rather huge. My project, when it's finished and working would be small enough to hide Intellivision system.

 

As for the 3 buttons from 2 buttons, you could code it like this:

if (B1 && B2) { // both buttons are down
digitalWrite (S3, LOW); // Intellivision controller line are pulled low when pressed.
}
else
{
digitalWrite (S2,!B2); //if either button is down, write low, ! inverts reading from source controller
digitalWrite (S1!B1); //if the source controller uses negative logic (low when pressed, high when not), eleminate !
}

 

I'm still learning coding so I'm not the best person for help. arduino.cc has a forum and also large free library where you could add to your arduino program. Also adafruit.com and sparkfun.com has forum for arduino and they sell arduino related accessories.

 

PS why is the keypad not matrixed? Arduino has library that can handle column and row decoding, and you'd need only 7 pins for a 3x4 keypad vs 12 individual pins.

 

PSS if only someone with FPGA experience could look at Intellivision video chip and it's weirdass address system and cook up a replacement video chip that can offer RGB output. Composite mod rarely helps and often looks worse, and Intellivision can't support anything better unless you get a really rare PAL model which do have RGB support.

Edited by Uzumaki
Link to comment
Share on other sites

Intv2 uses low to signal button press. The arcade type controller would do the same. Yeah I added the edit for matrix keypad and I get close, 22 lines vs. the 19 present. Perhaps I could just put directions and buttons into atmega328 and just hardwire the keypad up. This would 8 input and 8 output wires.

 

Mega 2560 cost is too high vs. the other options - thanks for the info though

Edited by grips03
Link to comment
Share on other sites

I just bought a Uno kit. Looks like a great tool to teach my son about electronics and software.

 

The relays are like $2.50 each, so cost needs to be less than $7.50 to be worth embedding Uno. Perhaps I'll do this for a one off for personal use. Makes a great hobby project.

Link to comment
Share on other sites

Since Ardunio has analog read I could build a resistor ladder to reduce the number of inputs. I wonder how well that would work. I've dones scripting in the past and Arduino seems very much like this, if then else, while, for, etc. Is PIC programming the same ?

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...