Skip to content

Latest commit

 

History

History
229 lines (152 loc) · 25.1 KB

README.md

File metadata and controls

229 lines (152 loc) · 25.1 KB

Game Boy MBC5 Cartridge

This is my design of a flashable MBC5-based cartridge for the Game Boy. The MBC5 mapper greatly augments the memory access of the Game Boy for larger games. Most of the games that came out in the last years of the Game Boy and Game Boy Color used the MBC5 mapper.

This circuit board should cover most MBC5 games. The features are as follows:

  • Able to make games up to 4 MB in size, that use up to 1 Mbit of RAM
  • Compatibility with all four of the popular Game Boy battery management ICs - MM1026, MM1134, BA6129, and BA6735
  • The option to add battery backup to the cartridge without the need of the original battery management ICs - perfect for MBC5 donors that didn't have batteries in them
  • Fully compatible with the GBxCart RW so you can transfer games and save files to and from the board

assemblepic

boardscan3

All gerbers and source files can be found in this repo, as this project is fully open source. Technical documentation of the board can be found in the Technical folder.

Important Things Before You Start

  1. To use this board, you need to have an original Game Boy game that uses an MBC5 mapper chip. You can find a list of games and their mappers here. Use the search function. Please note the RAM is in bytes, not bits. Since SRAM in this repo is defined in bits, you need to convert by multiplying the number of bytes by 8.
  2. You will need to remove the MBC5 from your donor cartridge for use on this board. This will require a hot air rework station or a hot plate. There's a list below of other parts you can re-use from the donor cartridge.
  3. When soldering parts on, it's a good idea to put kapton tape or otherwise cover the bottom cartridge edge. You do not want to get solder on the cartridge contacts.
  4. I am not responsible for any damage you do to your self or your property. Attempt this project at your own risk.
  5. I do not guarantee design compatibility. You may encounter issues with certain games. There is also a chance I have made an error in the design or the BOM - if this is the case, I will do everything I can to address the problem as quickly as possible.
  6. If you are using this board to make games other than for personal use, you must have permission from the originator to use and distribute any ROM images or other related material. You are responsible for making sure you adhere to any license requirements.

DO NOT use my circuit boards for profiting from stolen work - this especially includes homebrew content, ROM hacks, and using fan-made labels without permission from the originator. Support original creators!

Board Characteristics and Order Information

The zipped folder contains all the gerber files for this board. The following options must be chosen when ordering boards for yourself.

  • Thickness: 0.8mm
  • Surface Finish: ENIG
  • Gold Fingers: Yes, 30° chamfer

I sell this blank circuit board on Etsy, so you don't have to buy a bunch of multiples if you don't want to. (Click the banner!)

PCB from Etsy

You can use the zipped folder at any board fabricator you like. You may also buy the board from PCBWay using this link (disclosure: I receive 10% of the sale value to go towards future PCB orders of my own):

PCB from PCBWay

The board is also listed on OSH Park as well. Be sure to get them in 0.8mm thickness if you order from here.

Required Equipment

The EEPROMs on the board needs to be programmed somehow. I recommend using the GBxCart, as mentioned. These boards are fully compatible with it, and it makes reflashing games extremely easy using lesserkuma's FlashGBX software.

Alternatively, you can buy an EEPROM programmer with a TSOP adapter. The downside to this method is that you have to desolder the chip every time you want to program it. The FlashcatUSB is one popular option in retro spaces.

Battery Safety

When assembling a board, I recommend populating all the parts except the battery, and getting it to run initially without it. This is to make it easier to fix any solder connections that might need fixing, without having to worry about getting the battery hot. And if you need to rework anything near the battery after you've put it on the board, be safe and remove it before putting a hot soldering iron next to it.

And this should go without saying, but if you're assembling these boards with a hot plate or hot air, do not solder the battery on this way. You should use an iron, and keep heat off of the battery as much as possible.

(Also check polarity!)

Board Configurations

The board comes with five sets of jumper pads for solder bridges. SJ1, SJ2, SJ3, and SJ4 require you to solder bridge the middle pad either to the left or right pads. SJ7 is configured by either leaving the pads unsoldered or bridging them with solder. Here are the situations where you need to add solder bridges.

SRAM Size Selection (SJ1 and SJ2, or SW1)

These jumpers are located underneath the MBC5 chip, and labeled "64K" and "256K/1M". Solder them to configure the amount of RAM your cart uses. You must configure these pads for every game you make, unless you do not need RAM. You can find a list of games here with their respective RAM sizes.

  • If the game you're making uses 256 Kbit or 1 Mbit of RAM, then solder the middle pads of the two jumper sets to the right pads.
  • If the game you're making uses 64 Kbit of RAM, then solder the middle pads of the two jumper sets to the left pads.
  • SJ1 and SJ2 must be soldered in the same direction.
  • The footprint of these selection pads should allow for a DPDT switch, part number CAS-220A1, to be placed on these pads instead of having to bridge the pads with solder.

image

Note that you can make games that only require 64 Kbit of RAM and still use a 256 Kbit or 1 Mbit SRAM chip. You still need to configure the jumpers to the 64Kb setting, though.

I recommend using 64 Kbit or 256 Kbit RAM chips, unless you absolutely need 1 Mbit for the game you are making.

Using an MM1134 or BA6735 for U4 (SJ3)

Bridge the jumper SJ3 if you have either an MM1134 or BA6735 for U4, specifically. Any other battery management IC must leave SJ3 unsoldered.

Test Points and Final Checkout

On the back of the board are five test points. Here's where they are connected:

  • TP1: SRAM supply voltage
  • TP2: Battery voltage (after R1)
  • TP3: Battery voltage (positive terminal of battery)
  • TP4: Ground
  • TP5: VCC input voltage

After you assemble your game, you should measure the current out of the battery. But first, you should program it with the GBxCart, or if you programmed the EEPROM separately, put it into a Game Boy and cycle power once. Then, flip the PCB upside down on a non-conductive surface (not your leg), and set your multimeter in DC millivolts (or volts). Put the positive probe on TP3 and the negative probe on TP2. If you used a 10kΩ for R1, as indicated in the BOM, you should read a voltage in the single of millivolts. If you have something much higher, especially voltages above 20mV, then you likely have an issue or short circuit on the board somewhere.

Note: You need to power up the game at least once before battery currents will make sense - the battery management ICs can start up in an unknown state before applying main power to the board.

To estimate battery life, see this section in the Technical Design Document, or for more in-depth analysis, this Hackaday post.

Why not FRAM?

This board is only suitable for using SRAM. One downside to SRAM, if you haven't figured it out yet, is that you need a battery to keep the SRAM powered on even when the game is turned off. So eventually the battery will die, and your save data is lost. Some people have used FRAM, or Ferroelectric RAM, to keep save data around even after the battery dies (specifically, the popular part that's used for FRAM carts is the FM18W08). But, using this FRAM chip has a handful of downsides, and the benefit of keeping save data after the battery dies in my opinion does not outweigh the cons, which are as follows:

  1. Quality, new stock, 5V tolerant FRAM is expensive ($12+ per part).
  2. Cheaper FRAM chips from eBay or Aliexpress are notoriously flaky (anecdotally, ~50% success rate).
  3. FRAM memory access requires different chip select timing than SRAM, and the Game Boy expects SRAM, so it is not natively compatible with FRAM carts. The Gameboy Color specifically cannot (easily) be made to properly access FM18W08 chip. You can use an OR gate and add the CLK on the cart edge to try to achieve the necessary timing, but it only works (properly) for DMG/MGB/SGB, not the GBC. It usually works in practice for GBC, but it's technically a datasheet violation and can potentially cause issues in edge cases. (Thanks to gekkio for pointing this out!)

Brand new SRAM chips are ~$3, and having the SRAM footprint also allows you to use SRAM from an original cart if desired. You will easily get more than a decade of life running on a battery. You're already assembling this cartridge; you can dump the save and replace the battery before then!

Note that this isn't to throw shade at any FRAM-based carts, but for me personally, it's more trouble than it's worth. If you just need FRAM, you can find other cart designs out there that have it, like this one!

Board Fitment

The shape of this board was originally meant to mimic original Game Boy circuit boards as closely as possible (v1.3 and earlier). Unfortunately, when placed in some aftermarket Game Boy cartridge shells (like those from Cloud Game Store), the circuit board has a lot of freedom to rotate around the main screw hole in the bottom-middle of the cartridge. This can cause misalignment when you put it in a Game Boy, which can cause a game to either not load properly (garbled Game Boy logo) or shut off the Game Boy because of a short circuit. This isn't dangerous or anything, just annoying.

In order to make the boards fit nicer in any kind of shell, for v1.4 I added extended tabs of circuit board material to the edges of the cartridges to keep it from rotating too much in shells, which was suggested to me by orangeglo! (Thanks!)

If you're having trouble fitting the circuit board into a shell, because the tabs interfere with the cart edges, you can safely sand or trim them down as there is no copper within the tabs themselves. The only shell that appears to require any kind of trimming are Kitsch-Bent shells.

Bill of Materials (BOM)

Your parts list will vary depending on the game you are trying to make, and what chips you have for the battery management (if any). You cannot use both U4 and U5 - you must choose one or the other. U4 comes from a donor cartridge, and U5 is a readily available aftermarket option.

Please carefully review the parts you need for the board you are trying to make. Do not add any parts to your build that don't appear in the column for the game you are making. This means you cannot populate every component on the board at the same time.

Reference Designators Value/Part Number Package Description No save carts Save carts with MM1134 or BA6735 Save carts with MM1026 or BA6129 Save carts without donor U4 chip Source
B1 CR2032, CR2025, CR2016 CR2032 Backup Battery X X X https://mou.sr/3SeAzfT
C1 0.1uF 0603 Capacitor (MLCC) X X X X https://mou.sr/3ENc15O
C4 0.1uF 0603 Capacitor (MLCC) X X x https://mou.sr/3ENc15O
C5 0.1uF 0603 Capacitor (MLCC) X X X https://mou.sr/3ENc15O
C6 10uF 0603 Capacitor (MLCC) X X X https://mou.sr/3mZtSkF
C7 0.1uF 0603 Capacitor (MLCC) X X X X https://mou.sr/3ENc15O
C8 0.1uF 0603 Capacitor (MLCC) X https://mou.sr/3ENc15O
Q1 2N7002 SOT-23 N-Channel FET X https://mou.sr/3rgfh6J
Q2 2N7002 SOT-23 N-Channel FET X https://mou.sr/3rgfh6J
R1 10k 0603 Resistor X X X https://mou.sr/3riR7IH
R7 10k 0603 Resistor X https://mou.sr/3riR7IH
R8 10k 0603 Resistor X X X X https://mou.sr/3riR7IH
R9 130k 0603 Resistor X https://mou.sr/3MjXliy
R10 49.9k 0603 Resistor X https://mou.sr/3Q3NRZO
U1 29F016, 29F032, 29F033 TSOP-48, TSOP-40 Flash EEPROM X X X X AliExpress or eBay
U2 MBC5 QFP-32 MBC5 Mapper X X X X Donor MBC5 Game Boy cartridge
U3 AS6C6264, AS6C62256, AS6C1008 SOP-28, SOP-32 SRAM X X X https://mou.sr/3ZxG6jd
U4 MM1026, MM1134, BA6129, BA6735 SOIC-8 Battery Management X X Donor Game Boy cartridge
U5 TPS3613 MSOP-10 Battery Management X https://mou.sr/45Ir2kh

Note that C9 - C11 footprints are only included on the board for strange edge cases that may require them sometime in the future; do not populate! See the technical design document for more information.

Usable Donor Cartridge Parts

You can use a few parts from the donor cart on the new board to save some money. Note that you will generally get better reliability with new parts as opposed to old ones. For example: I have seen failed RAM chips from donors in the past.

  1. U2: MBC5 - This one is required
  2. U3: SRAM - You can use this part only if the game you're making uses the same or less amount of RAM that the donor cartridge does
  3. U4: Battery Management IC - Using this is probably preferred over the TPS3613 because it'll save you money and parts to put on

You could probably transfer over most of the 0.1uF capacitors but they're pretty cheap anyway, so I generally just recommend buying new resistors and capacitors.

Capacitors C9 to C11

If you want to experiment with the capacitors C9 to C11, see this info below. Be aware that adding these components in some of my tests actually stopped games from working, so again, assume that if you have a problem it lies elsewhere first, because it almost certainly does.

  • C9 is a capacitor connected nearby the SRAM's /WE pin to GND. These were populated on some cartridges, and I believe have a value of approximately 1 nF (0.001 uF) based on measurements from an MBC1 board that used it.
  • C10 is a capacitor connected from the cart edge /RESET pin to GND. A spot for this capacitor was included on some MBC5 carts, but I cannot locate an instance of it actually being used when looking through the gbhwdb. I don't actually know what value this capacitor would need to be, so I am guessing 1 nF.
  • C11 is a capacitor that I have added that was not used on any original Game Boy board. It connects to the SRAM's /CE pin, bypassing to GND. I have added this in the event incompatibilities arise with newer SRAM chips that have much faster speeds than older SRAM chips. This was a problem I encountered on some of my NES cartridges, so this is here just in case, but I have not found an instance where it's required.

Things to Remember

  • The footprint for the EEPROM is specifically for 29F016 - it has 48 pins. However, 29F032 and 29F033 are only 40 pin devices. They still work fine on the board though - place them in the center of the footprint, and leave the outer two pins on each corner empty
  • The 29F016, 29F032, and 29F033 have been known to occasionally be defective upon arrival. They're either used, or new old stock, and usually only available from AliExpress.
  • The footprint for the battery can fit a CR2032, CR2025, or CR2016 with solder tabs. The only difference is the mAh capacity (larger number = longer life). If you get Panasonic tabbed batteries, you may have to trim the battery tabs to make them fit on the footprint.
    • For untabbed coin cells, you can find battery retainer adapters online, like this one, but only for board revision v1.4. It will not fit on earlier revisions.
  • For battery management, use either U4 or U5 and supporting components. Do not use U4 and U5 simultaneously on one board. They will interfere with each other.
  • Generally, ROM sizes are conveyed in terms of kilobytes and megabytes (KB, MB). RAM size is usually conveyed in terms of kilobits or megabits (Kbit, Mbit). You can convert Kbit and Mbit to KB and MB by dividing Kbit or Mbit by 8. For example, 256 Kbit = 32 KB.
  • You only need to provide ROM and RAM chips that have at least or greater the size of the game you are trying to make. That means you can use a 256 Kbit SRAM chip for a game that only requires 64 Kbit of RAM!

Labels

If you want a Bucket Mouse branded label for your cartridge, look no further than krizdingus's designs. Special thanks to Kris for designing these, they look awesome! (If you are going to order/print these, use the high-res images hosted on his website, and keep the labels for personal or non-commercial use only.)

image

Revision History

v1.4

  • Reduced cart edge by 0.1 mm for better fitment
  • Adjusted battery placement to support more battery holders
  • Added tabs on the board edges to allow the circuit board to fit better in aftermarket cartridge shells

v1.3

  • Extended cart edge down by 0.25 mm for better fitment
  • Added OSHW logo and "SUPPORT ORIGINAL CREATORS!"

v1.2

  • Replaced non-donor battery management circuitry with a TPS3613-based circuit for smaller BOM and easier routing

v1.1

  • Moved all parts on the top down to allow for compatibility with DMG-style shells
  • Rotated battery for more space
  • Widen SRAM footprint for easier soldering
  • Renamed some reference designators for consistency between designs
  • Changed silkscreen for clarity
  • Removed multicart option

v1.0

  • Release revision

Resources and Acknowledgements

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are able to copy and redistribute the material in any medium or format, as well as remix, transform, or build upon the material for any purpose (even commercial) - but you must give appropriate credit, provide a link to the license, and indicate if any changes were made.

©MouseBiteLabs 2023