Thursday, June 26, 2008

How To Make a 32KB Sega Master System Cartridge

This tutorial is a step-by-step guide on how to make your very own 32KB Sega Master System cartridge. The cost is quite low (if you have a programmed EPROM or you are able to program your own) - I payed around AU$8 in parts for one of my carts as made in this tutorial.

These carts have been tested on a PAL SMS 1 and a PAL SMS 2.

The good news is that the cartridges use a re-programmable EPROM, provided that you have the appropriate facilities (EPROM programmer and EPROM eraser).

This tutorial would not have been possible without the Sega Master System cartridge port connector pinouts as found one Maxim's page: Maxim's webpage is an excellent resource for all things that are related to the Sega Master System, and I would like to thank him for the amount of effort and time he has put into creating it.

After the step-by-step section, there is a pinout for the cartridge PCB.

1. You will need a 27C256 EPROM chip. In this tutorial, I use an ST Microelectronics 27C256B chip. If you are using your own EPROM programmer, ensure that the programmer is able to write to both the EPROM model and manufacturer type. This should be documented within the programming software that came with your programmer or with any relevant printed documentation.

2. You will need a Sega Master System cartridge. In particular, we are looking for a cartridge with a single chip on the board. This chip should be a wide-body chip with 28 pins. The printed circuit board that I have used so far is the model 171-5519. I have found the correct chip size and printed circuit board in AUS PAL versions of The Ninja, World Grand Prix and F-16 Fighter, all of which are fairly common. This tutorial should work with many other games as well.

3. You will need a 28 pin, wide body socket. However, I did not have any handy at the time and my local electronics shop had run out of stock. So, I used a 40 pin wide body socket instead.

4. Remove the two screws on the back of the cartridge. Inside you will find the cartridge circuit board.

5. Check that the board only has one chip on it, and that that chip is a 28 pin, wide body chip. There should also be a ceramic capacitor in the top left and an electrolytic capacitor on the right side of the board.

6. Carefully desolder the chip. I usually use a vaccum solder pump for this sort of thing, because it is quite quick but it is not always 100% reliable (ie. sometimes a point must be worked on more than once before enough solder is removed). Perhaps you feel more comfortable with desoldering braid.

7. Here you can see the front of the board with the missing chip.

8. You will need to cut off the bottom six legs of each side if you are using a 40 pin socket like me.

9. Here you can see the 40 pin socket with the 12 legs removed.

10. You may need to bend the ceramic capacitor in the top left hand corner to the left.

11. This way, the top of the socket has room to fit correctly in place.

12. If you are using a 40 pin socket like me, you may need to move the electrolytic capacitor in the middle right hand side of the board over a touch.

13. This way, the bottom of the socket has enough room to fit correctly in place.

14. Place the socket on to the front face of the board, so that the twelve legs that were cut off earlier are on the right hand side of the board (if you are using a 40 pin socket like me). The stubs of the cut off legs should not touch the surface of the circuit board (if you are using a 40 pin socket like me).

15. Here you can see the socket sitting in place from the back of the board.

16. Solder the socket into place.

17. If your EPROM has been used before, you will need to erase it. For my ST 27C256 EPROM, I set my erase timer to 10 minutes. The amount of time required to erase your particular EPROM might be different, depending on the manufacturer.

18. Program the EPROM with the (legal) ROM of your choice. In my case, I am programming a homebrew test program. I am using a TOP2007 general programmer, which is USB powered - quite convenient. However, I did have to install the latest software from their website in order to be able to program the 27C256 without errors.

19. Gently place the EPROM into its socket. You may need to gently change the angle of the pins, so that they align with the socket correctly.

20. Enjoy your cartridge.

21. You may also like to solder your EPROM onto the board directly, as shown above. If so, do so gently and make sure you apply the soldering iron to the legs of the EPROM for short amounts of time only. The disadvantage of using a soldered EPROM is that you can only really program it one time.

23. The advantage is that it can fit inside an old cartridge shell.

Cartridge PCB Pinout
If you are interested in the pinout of the IC socket compared to the Sega Master System port, then this photo can help you.
The IC socket shares the same pins for both the front and the back (of course) but the edge connector that mates with the actual Sega Master System has two sides. The front side has the even numbers from 2 to 50 and the back side has the odd numbers from 1 to 49. This pinout is of course only relevant to boards that have a single, wide body 28 pin ROM chip on them to begin with.

The front side is the one where the ROM chip faces upwards, and the face of the front points towards the front of the Sega Master System when inserted into the console.

As one can see below, the pinouts of the socket on the PCB when compared to the SMS cartridge port in light of using a smaller size EPROM (i.e. 32KB) works out very nicely, and no changes or rewiring are required.

2 33 A12
3 32 A7
4 31 A6
5 30 A5
6 29 A4
7 28 A3
8 27 A2
9 26 A1
10 25 A0
11 24 D0
12 23 D1
13 22 D2
14 19,20,21 0V

28 1,35 5V
27 6 A14
26 7 A13
25 8 A8
24 9 A9
23 10 A11
22 11 CART: !M0-7; EPROM: !OE
21 12 A10
20 13 !CE
19 14 D7
18 15 D6
17 16 D5
16 17 D4
15 18 D3


Maxim said...

If you cut a hole in the front of the cartridge, there should be room for the EPROM in the socket, and it'll be more accessible too. A ZIF socket might be a better option if you're going to reprogram it a lot.

Sebastian Tomczak said...

Oh, hey Maxim. Yes, I am aware of the "cut a hole in the cartridge case" trick, but I think it looks ugly! So for me, I think it will either be with a socket and with a case, or with a case and without the hole or socket... ie a non-reprogrammable cartridge.
Zif socket would be cool to add as well!

Anonymous said...

Great project!
Now is there a way to, instead of reprogramming the chip every time you want to try a different game, to somehow directly connect it to a computer.
Then have the computer emulate the chip.

Sebastian Tomczak said...

Hi Chris,
I think I understand what you mean, and the answer is perhaps a no. But an easier option for a similar sort of thing might be something like Tototek's SMS flash cart, which is easy to deal with but 10 times the price. I guess the cool thing about doing things this way is that each cartridge is very cheap and not very time consuming, but of course one is limited to a ROM size of 32KB...

10k said...

You never cease to blow my fucking mind, Seb.

petersteel said...

that was really nice to read that.. that was really great post.. it seem great information..that's great job... for more information on Nintendo, Nintendo NES,used Nintendo 64, Used Nintendo u can visit

Anonymous said...

I opened some games and the top left capacitor is not a round one but a small cylinder.
Is this board ok too?

affan said...

how in the world do you put a rom on the eprom? is there any particular program that I need to use? what sizes do sms roms range from? are they all equal to or less than 32KB? do eproms have differant storage capacities(more than 32KB)? you mentioned the tototek sms flash cart above. they also have a genesis flash cart, which functions similarly to the sms flash cart, so can this project work on a genesis cartridge as well?

cracker said...

The ROMs need to be written with an E/EPROM burner. The one I use is the True-USB PRO GQ-4X ( The cost won't justify using it for only this project though for most people so you would want the Neo SMS Myth or Master Everdrive (better of the two because you can use SD cards and it is cheaper).

Anonymous said...

love the tutorial, I want to do one of these aswell as one for the nintindo and my ti994a. any tips or suggestions?

Sphax said...

Hello Seb,

I'm following your blog for quite a few month now and there are still many question i'd like to ask.

I have read the main part of the SMSpower website as well as Charles MacDonald's doc and hardwares notes.
But i feel that (even if it's of great help) all these stuff are mainly for Emulation and not directly for a real-time control of the SMS .

My idea is to control the console with an Arduino, just like you did with your awesome project ;)
The point is that I don't want to buy and control an independent SN76489 (like you did in your beginnings project) but accessing directly the integrated one in the VDP.
The problem is that i'm not sure if you can do that directly with the Arduino and sending data via the Cartridge pinout port or if you don't have any other choice than reprogramming an EEPROM and writing assembly code to access the integrated PSG?

I hope you'll find a moment to read this long message.

Take Care ;)


PS: My mail address said...

Wow, there is a great deal of useful data above!

Anonymous said...

Thank you for posting the great content…I was looking for something like this…I found it quiet interesting, hopefully you will keep posting such blogs….Keep sharing. Love your blog
Printed Circuit Board