Repair & Schematics
Sega Mega-Tech Arcade

Button Interface (Sega Mega-Tech)

18min

The IC24 I/O Expander connects the SMS Z80 data pins through to the CN2 (Select Buttons) and CN4 (Player 1 buttons), via the optocouplers and multiplexers.

NOTE: The Mega-Tech doesn't seem to support 6-Button mode controllers considering the Left and Right secondary pins are grounded.

In order for the buttons to work, you must first short the 5V supply from CN2 pin 17 to pin 16 (which is also connected to pin 15). This provides the 5V power to the button pull-up circuit.

The LEFT, RIGHT, PU, DOWN, A, C and Start are all disabled by the !1G Output enable pin controlled by the SMS, until credits are inserted, so these buttons will not work unless you have credits.

Send A2 button to ground on CN2 to add credits.

The harness typically does this for you.

5V Button Pullup
5V Button Pullup
īģŋ

Now all you need to do is short the desired buttons to ground to press them.

CN2 Pinout
CN2 Pinout
īģŋ

Player 1 (CN4) and Player 2 (CN7) are identical pinouts.

Player Buttons
Player Buttons
īģŋ

Opto-coupler Inputs

The arcade buttons connect to the headers and short to the ground pins when pressed.

All outside connectors to the physical buttons (buttons from Player 1 CN4, Player 2 CN7 and Select CN2 for example) pass through NEC 2501 photocouplers to isolate the buttons physical shorting to ground from the ICs inputs. It adds a bit of protection.

NEC 2501 Photo Coupler
NEC 2501 Photo Coupler
īģŋ

The buttons are pulled high to 5V on the diode Anode side (positive) via RA30 (Player 1) / RA24 (Light Gun), RA21 (Player 2), RA17 & RA11 (SELECT CN2), and then the button shorts the Cathode (negative) to ground to turn the LED on, which in turn saturates the base of the photo-sensitive transistor on the output side (pins 9-16) triggering the output sides (Collectors) to pull low also.

When you ground the cathode on the input side you are basically grounding the LED inside the photo-coupler, turning the LED on. That light shines on the photo-sensitive transistor on the output side, turning its base on.

The transistors on the output side are pulled high to 5V on the collector pins via RA29 (Player 1), RA23 (Light Gun), RA20 (Player 2), RA16 & RA10 (SELECT CN2).

To bypass the photo coupler ICs all together you can just short the collector pins (10, 12, 14 and 16) to ground to simulate button presses.

Cabinet Button Logic Paths

As the button interface is not a direct to ground circuit, the buttons pass through a bunch of logic chips (multiplexers, buffers, OR and AND gates), to form the final inputs into the Master System.

Select Button

The SELECT button (CN2 pin 1) comes in through PS2501 Optocoupler IC36 (pin 2, pin 16), into Port A0 of the IO Expander (IC24 pin 54).

This data is transmitted back to the SMS Z80 data pins D0 to D7 via the IO Expander D0 to D7 pins (pins 36 to 40, pins 30 to 32).

The SMS system will automatically cycle the game slot every 90 seconds if it doesn't detect any coins / credits in the machine.

This isn't from an actual press of the Select button but done by the SMS BIOS directly.

īģŋ

Document image
īģŋ

Player 1 Button Logic Paths

As the button interface is not a direct to ground circuit, the buttons pass through a bunch of logic chips (multiplexers, buffers, OR and AND gates), to form the final inputs into the 315-5309 chip.

Player 1 Logic Path
Player 1 Logic Path
īģŋ

Up Button

The UP button (CN4 pin 1) comes in through PS2501 Optocoupler IC68 (pin 2, pin 16), through the 74LS244 Buffer (IC62 pin 2) and out of pin 18 into the 315-5309 as the UP input (pin 50 EM11).

Down Button

The DOWN button (CN4 pin 2) comes in through PS2501 Optocoupler IC68 (pin 4, pin 14), through the 74LS244 Buffer (IC62 pin 4) and out of pin 16 into the 315-5309 as the DOWN input (pin 51 EM12).

Left Button

The LEFT button (CN4 pin 3) comes in through PS2501 Optocoupler IC68 (pin 6, pin 12), through the 74LS257 Multiplexer (IC67 pin 3) and out of pin 4 into the 315-5309 as the LEFT input (pin 52 EM13).

Right Button

The RIGHT button (CN4 pin 4) comes in through PS2501 Optocoupler IC68 (pin 8, pin 10), through the 74LS257 Multiplexer (IC67 pin 13) and out of pin 12 into the 315-5309 as the RIGHT input (pin 53 EM14).

A Button

The A button (CN4 pin 5) comes in through PS2501 Optocoupler IC63 (pin 2, pin 16), through the 74LS257 Multiplexer (IC67 pin 5) and out of pin 7 to the 315-5309 as the A/B input (pin 54 EM16).

B Button

The B button (CN4 pin 6) comes in through PS2501 Optocoupler IC63 (pin 4, pin 14), through the 74LS08 AND Gate (IC57 pin 1, pin 3) back through the AND Gate (IC57 pin 12, pin 11), into the 74LS257 Multiplexer (IC67 pin 6) and out of pin 7 to the 315-5309 as the A/B input (pin 54 EM16).

C Button

The C button (CN4 pin 7) comes in through PS2501 Optocoupler IC63 (pin 6, pin 12), through the 74LS257 Multiplexer (IC67 pin 10, pin 9), through the AND Gate 74LS08 (IC57 pin 4) and out of pin 7 to the 315-5309 as the START/C input (pin 55 EM18).

Start Button

The START button (CN4 pin 8) comes in through PS2501 Optocoupler IC63 (pin 8, pin 10), through the 74LS257 Multiplexer (IC67 pin 11, pin 9), through the AND Gate 74LS08 (IC57 pin 4) and out of pin 7 to the 315-5309 as the START/C input (pin 55 EM18).

The AND Gate (IC57) in order to allow the START/C to be in a released (high) state, must have its pin 5 (second of the AND inputs) high.

This pin 5 goes to the I/O Port Expander IC24 on the left top pin 52 (Port X2).

So, for the START/C buttons to work on the Mega Drive, the pin 52 must be high 5V.

The Start also goes through PS2501 Optocoupler IC63 (pin 8, pin 10) through the 74LS32 OR Gate (IC51 pin 1, pin 3) into AND Gate 74LS08 (IC57 pin 2, who's other input pin 1 is B Button) back through the AND Gate (IC57 pin 12, pin 11), into the 74LS257 Multiplexer (IC67 pin 6) and out of pin 7 to the 315-5309 as the A/B input (pin 54 EM16).

Select Input

The controller interface uses the SELECT input (315-5309 pin 56 EM17) to select which button is read on the A/B and START/C inputs.

The 315-5309 generates this signal, however it can be overridden and driven low if the !2G of the 74LS244 Buffer (IC62 pin 19) is also low, as SELECT is connected to the output of 2Y3 (pin 5), with the input pin 15 sunk to ground via a 4.7k resistor.

The Select input (315-5309 pin 56 EM17) goes to the PS2501 Optocoupler IC58 (pin 14 output) so gets sunk to ground when a light gun is used, disabling the Player 1.

This pin is pulled high via the RA23 resistor array.

!1G Output Enable

The output enable for the 74LS257 Multiplexers (IC67 / IC45) and the !1G output (for UP/DOWN Buttons) of the 74LS244 Buffer (IC62) connect to the OR Gate 74LS32 (IC51 pin 8).

The two inputs of IC51 (that if high disable the output) go to:

  • Pin 9 (3A) connects to IO Expander (IC24 pin 23 Port D3).
  • NO CREDIT - Pin 10 (3B) connects to the IO Expander (IC24 pin 22 Port D2).

If either of these are high, it disables the buffer / multiplexers and the Mega Drive cannot read the controller buttons.

!A/B Invert

The !A/B pin of the 74LS257 Multiplexer (IC67 pin 1) looks like the SELECT pin, as it pulses low once a frame just like the SELECT pin.

However, it is not directly connected. The IC67 pin 1 connects to the OR Gate 74LS32 (IC71 pin 11).

I/O Port Expander

The Start buttons also go into the CXD1095 port expander, to then make their way to the Master System side for the Test menu and Game Menu.

Read the Port Expander IC24 section for more details.