Ever want a 4-wire powered controller interface?

Discussion in 'Arcade and Supergun' started by Calpis, Feb 25, 2008.

  1. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    I've thought of (what I think is) a clever simple way to connect a controller (such as for a supergun) to a base unit/console through a 4 wire interface. The theory starts with the standard use of parallel load shift registers like the SNES uses, but multiplexing the register's output with the clock signal to reduce the pins from 3 unidirectional to 1 uni, 1 bidirectional in order to have a powered interface on only 4 wires instead of 5 (there aren't any 5-wire household connectors). I plan to use this idea sometime with cheap/common RJ-14 punchdowns/patch cords to connect my controllers instead of expensive/rare/amateurish Neo DA-15 connectors, giant DB-25, DE-9s (hard to find plastic connectors and needs even more expensive logic for 12+ buttons) or some other silly interface like a ribbon cable.

    The idea:
    [​IMG]

    When the console tristates the CLK line, the controller's data will take over the bus, with the resistor though the console can drive the line high again to clock the register. All it means logically is one more bit in your state machine.

    The state machine:

    0: load
    1: pull CLK high
    2: tristate
    3: clock data in
    4: pull CLK low, goto 1 unless all buttons are read, then goto 5
    5: clock output latch to sync all buttons, goto 0

    I put it together using 50 states to read in 12 buttons (U,D,L,R,1P,COIN,1-6), so with a common 48 kHz clock you can have 16x button oversampling and the controller end draws like 1mA at 3V.
     
    Last edited: Feb 25, 2008
  2. Senshu

    Senshu Member

    Joined:
    May 21, 2007
    Messages:
    12
    Likes Received:
    0
    Hi Calpis :}

    Any progress with this great project ?
     
  3. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    It's all ready to use in the first post :) If you mean a Supergun, I can't decide whether or not to go through with it, it's a big project if you want to make something pretty like a Sigma unit.
     
    Last edited: Mar 10, 2008
  4. Senshu

    Senshu Member

    Joined:
    May 21, 2007
    Messages:
    12
    Likes Received:
    0
    Well, I was hoping for more detailed diagram, with IC name, resistor value etc. I'm not really into this kind of things :/
     
  5. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Sorry I didn't plan to post diagrams or anything since I implemented it into a CPLD chip with a SNES controller, not from individual chips. This project would be pretty complicated in individual chips due to the state machine. In fact I only chose it because my Supergun design already had a CPLD for button remapping.

    The resistor in the diagram is any large resistor, I used a 10K. If you want to build it from scratch, for the controller I would recommend two 74HC166 or a SNES controller with the clock line connected to the data line through a 10K resistor, same principle.
     
  6. Senshu

    Senshu Member

    Joined:
    May 21, 2007
    Messages:
    12
    Likes Received:
    0
    Oh, now I see. I thought you would release more info later, on how to decode outputs off such a controller device (snes controller, or custom made one). That's something I'm also looking forward to implement in my supergun :)
     
    Last edited: Mar 10, 2008
  7. retro

    retro Resigned from mod duty 15 March 2018

    Joined:
    Mar 13, 2004
    Messages:
    10,354
    Likes Received:
    822
  8. Jamtex

    Jamtex Adult Orientated Mahjong Connoisseur

    Joined:
    Feb 21, 2007
    Messages:
    5,472
    Likes Received:
    16
    It's easy enough the decode a NES output with a 4094 and a 7555 circuit as a clock and a 4516 to supply the (P/S) signal, alternatively you could use a microcontroller.
     
  9. retro

    retro Resigned from mod duty 15 March 2018

    Joined:
    Mar 13, 2004
    Messages:
    10,354
    Likes Received:
    822
    NES wouldn't work - not enough buttons. It'd be OK for some games, i.e. non-fighting games, older games etc, but 2 buttons isn't generally enough.

    You really need SNES, MD or best of all, Saturn pads for this. That said, I'm not one for playing arcade games on a pad - use a stick!
     
  10. Jamtex

    Jamtex Adult Orientated Mahjong Connoisseur

    Joined:
    Feb 21, 2007
    Messages:
    5,472
    Likes Received:
    16
    It's easy enough the decode a SNES output with two 4094s and a 7555 circuit as a clock and a 4516 to supply the (P/S) signal, alternatively you could use a microcontroller.

    Only using NES as an example as I am gutting a NES and making it a hybrid Mahjong / JAMMA supergun. As all the games I want to play are no more then 2 buttons then it means it's easy enough to reuse the NES pads without modification. ;)
     
    Last edited: Apr 28, 2008
  11. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Yeah definitely 4094 are the way to go since they save you output registers but instead of a 555 timer I'd recommend making an RC oscillator from one or two gates of a 7400 or 7402 so you can use the others in your state machine.

    Saturn pads are actually really easy to interface to a Supergun, but finding the Saturn connectors and using so many separate 4-bit latches? Ugh, I just prefer SNES for their commonness. MD 6-button pads are also nice (I prefer them to Saturn pads) but the logic involved is pretty convoluted and not very suitable for discrete logic.
     
  12. Jamtex

    Jamtex Adult Orientated Mahjong Connoisseur

    Joined:
    Feb 21, 2007
    Messages:
    5,472
    Likes Received:
    16
    How do megadrive 6 button pads work from a electronic point of view as people say "Oh it's really complex" but don't give any reasons why... I would love to use a 6 button megadrive controller as it uses a 9pin D plug which is easy to buy unlike the SFC, NES, Saturn, etc. Wonder how easy the Jaguar pad would be to wire up? :D It's sad that the Playstation and later controllers do require a microcontroller. :(

    Just glad that the 24 odd buttons in Mahjong controllers are just a simple matrix keyboard layout. :D
     
  13. retro

    retro Resigned from mod duty 15 March 2018

    Joined:
    Mar 13, 2004
    Messages:
    10,354
    Likes Received:
    822
    Last edited: Apr 28, 2008
  14. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    It works by toggling the MUX select line more than normal during a specific period (determined by an external oscillator?), the reason I didn't think the controller was suitable for discrete logic though is because before reading that protocol description I thought it was impossible to oversample the controller with the internal oscillator, now I'm not so sure if that's how it really works. Maybe sometime I'll hook it up to the parallel port for some testing.

    BTW, another easy to interface controller is the PCE 6-button, it also comes with turbo buttons, but I don't know of a 6-button arcade stick, so again I say go with SNES.

    BTW2, here's either Kashima-san or Capcom's SNES pad decoder: http://kaele.com/~kashima/games/fcsi_rec.pdf
    You don't actually need the 7407 though unless you intend to interface your decoder to an open collector interface (where multiple controllers control the same signals.)

    I've just come up with a little tricky simpler/more common/cheaper solution though using just:
    1x 74161
    1x 7400 (may need to substitute for 74132 if oscillator won't oscillate)
    4x 4094
    single resistor and capacitor for the oscillator

    It also works with both the SNES controller (asynchronous load) or *synchronous* shift registers like the 74166 too. Won't just post it though since I'm unemployed and need some sort of little compensation for my time ;)
     
    Last edited: Apr 29, 2008
  15. djelaba

    djelaba Benzin !, Site Supporter 2013

    Joined:
    May 12, 2005
    Messages:
    257
    Likes Received:
    11
    Sorry to bump this topic, but any news on this little project?
    (didn't notice you were also known as kyuusaku on other boards ;-))
     
  16. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    No news, I finished it before that post I believe. No motivation to draw up a schematic though sorry ;)
     
  17. djelaba

    djelaba Benzin !, Site Supporter 2013

    Joined:
    May 12, 2005
    Messages:
    257
    Likes Received:
    11
    *cast "motivation" on Calpis*
    :icon_bigg
    Charles McDonald once did a similar project, but the archive is now unavailable.. :-(
     
    Last edited: Nov 14, 2008
  18. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Ok ok, I'll waste some time soon drawing something up. I haven't done it since the program I like to play with doesn't have a 4000 series library so I have to make the symbols. I respect Charles Macdonald greatly but I just have to put something better out there, a PIC instead of a few discrete parts? He consistently makes things 10x more complex (and expensive) than me :D
     
    Last edited: Nov 14, 2008
  19. Piglet

    Piglet Spirited Member

    Joined:
    May 28, 2008
    Messages:
    175
    Likes Received:
    0
    Slightly OT, but I think the NES controller only used 4 lines. I remember you did a write somewhere & the data (all 8 bits) was rotated out of a single bit. Those were, as the ond saying goes, the days...
     
  20. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    The NES controller works the same as SNES, both use 5 lines (or 6 for FC's 2P microphone):
    -clk
    -data
    -load
    -+5v
    -gnd

    Edit: here is my super cheap 4/6 chip implementation:
    [​IMG][​IMG]

    The only hard part may be getting the oscillator to oscillate.
     
    Last edited: Nov 15, 2008
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page