Skip to the content
2 layers51 × 61 mmGameboy CPLD Cart + FRAM, the printed circuit board in 3D

Gameboy CPLD Cart + FRAM

sillyhatday/GAMEBOY-CPLD-FRAM-2MB16

A CPLD implementation of the MBC5 mapper

Size
51 × 61 mm
Copper layers
2
Thickness
1.6 mm
Parts
23
Nets
64
Pads
194
Tracks, vias
1,260, 135
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
4 Jul 2024
Updated
25 Jun 2026

Overview

Gameboy CPLD Cart + FRAM is an open-source printed circuit board by sillyhatday, from the sillyhatday/GAMEBOY-CPLD-FRAM-2MB repository on GitHub, published under the CC-BY-SA-4.0 licence. It is a 2-layer board of 51 × 61 mm with 23 parts on 64 nets, routed with 1,260 tracks and 135 vias.

It is built around the 74LVC1G332GV and FM1808B-PG. Its parts include 6 capacitors, 5 ICs, 1 resistor and 1 connector. It belongs with the retro computing and games and fPGA and programmable logic boards and the FPGA and CPLD boards of this library.

Main components

2

README

README.md

GAMEBOY-MBC5-CPLD-2MB

[!WARNING] Current circuit board revision does not include support for the MAX7000 or ATF150x CPLD without bodges.

Introduction:

This is my take of a CPLD based flash cart for the Gameboy.

The whole project is based from Alex's project from years back. Without that project, I would never have picked this up and spend my time figuring out how to work with CPLDs. I am not a programmer and do not claim to be. Picking up Alex's code I can see how things work with my previous knowledge of how carts operate.

The newest update has been done with the help of AI. I just wanted to get this thing done so it is off my active project list. Even though AI has helped, I have learned a little bit more about how CPLDs work because of it. In the future I'd like to use the knowledge to do another project.

Some reasons to build this project are:

text
+ No need for sourcing a donor cartridge
+ Multi MBC compatibility
+ Cheaper to build vs a donor cart (initially not, more made, more saved)

[!IMPORTANT] This project is designed with MBC5 functionality as the main priority. Compatibility with MBC1 is added on top, therefore, compatibility is not guaranteed. Super Mario Land 2 & Zelda: Link's Awakening work here, where they have issues running on a normal MBC5 chip. However, Donkey Kong Land does not work. Maybe one day I can create an MBC1 CPLD mapper.

[!NOTE] For updates, see towards the end of the readme

🟦 Project State:

:green_circle: Done

text
- Get a cartridge that works well enough
- Make the Altera 3032A & 3064A both work
- Fix SRAM problems with MAX7000 and edge case MAX3000
- Fix this readme after half updating and rage quitting. Remove V2.0 PCB pics.
- Write draft of instructions for programming Atmel chips

:yellow_circle: In Progress

text
- Do some power tests of carts I have built so far.

:white_circle: To Do

text
- Test flashing Atmel chips in circuit
- Design some hardware to flash Atmel chips in circuit
- Update PCB to include solder jumper for different CPLD families.
- Some issues with SRAM in FlashGBX with Atmel 1502A. Check hardware over & adjust SVF export settings.
- Move FRAM chip select glue logic into software.

🟨 Prerequisites

text
* The full components parts list and cart PCB
* (Optional) JTAG adaptor PCB
* Altera USB Blaster or FT232 for JTAG (cheap clones work)
* Windows PC with Quartus II Programmer, Quartus II Web Edition or OpenOCD
* GBxCart and related software
* Modified Gameboy cart shell or (optional) 3D printed Game Gear cart adaptor
* Equipment to solder tiny SMD components
* Skills to solder tiny SMD components reliably

🔌 CPLD Information

[!TIP] Information on chosing a CPLD
ALTERA PROGRAMMING GUIDE
ATMEL PROGRAMMING GUIDE
CPLD POWER USAGE

Prices vary, these are typical.

ModelCost x1Vendor
3032A:€1.16Aliexpress
3064A:€1.60Aliexpress
7032S:€1.85Aliexpress
1504A:€1.97Mouser

Depending on the model, the AP2127K-3.3TRG1 may not be needed.

ModelAP2127KJumper
3032AYESNO
3064AYESNO
7032SNOYES
1502ANOYES

🟦 Parts List

Cartridge x1

[!IMPORTANT] When ordering cartridge PCBs, make sure to choose 0.8mm thickness and gold plating.
Altera MAX3000 & MAX7000 CPLDs are obselete and only found on Aliexpress. I suggest the 3032A. (MAX7000 is a relic at this point).
If ordering MAX7000, get the S version, otherwise throw your money in a fire. Eg, EPM7032S
Atmel ATF150x parts can be bought new from reputable sellers. However they are trickier to program for the average person.
Order FRAM from Aliexpress & eBay at your own risk, they are known to be extremely unreliable.

Part No.PackageQty
29F016TSOP481
FM1808SOIC281
CPLD*TQFP441
74LVC1G332TSOP61
AP2127K-3.3TRG1**SOT23-51
Cap 100nF06034
Cap 1uF06032
Res 10K06031

*EPM3064A, EPM3032A, EPM7064S, EPM7032S, ATF1504A or ATF1502A **See CPLD info

JTAG Adaptor

Part No.Qty
DS Lite Cart Conn1
USB C USB41251
Pin Headers2x5-P2.54mm
GG Adaptor or Shell1
USB Blaster1

[!TIP] Link to Game Gear Adaptor

Build Photos

cpldfram3 cpldfram1 cpldfram2

Different CPLD
CPLDcartclose

Original Prototype
Prototype3064A

Update June 2026

I've picked this back up again when I found a PCB laying about. I had to wonder if AI was good enough now to help improve things. It is fortunately.

The previous update I was naive to think programming in C++ was anything like Verilog. I mean it is, but the device being programmed works so differently to other CPU based systems.

The issue that has been plaguing the 7032S & 1504A, is the save RAM functionality. Games would not save, or correctly use the cartridge as work RAM. This was on the Gameboy and cart readers. I tested this over a few carts and the first one kinda worked. It was flaky but saving, yet only on the GB and not the cart reader. There worst problem is that this problem crept into some of the 3032A and 3064A carts also.

This code refactor seems to have fixed all these problems, not only the MAX3000 but the MAX7000 also. As of now, the ATF1504 is untested. I am hopeful that it will work also. Programming those is more complex and I've since forgotten how to do it.

The smaller EPM3032A, EPM7032S & ATF1502 with 32 macro cells are now more than big enough to fit the program, no longer is it so tight. This is thanks to removing the 128KB RAM functionality, reducing the amount of registers required to address that has gained a lot of space. Additional code can be added for more functionality such as moving the FRAM gate logic into the CPLD and making it user programmable with a solder bridge on the PCB.

This is all very nice as the smaller chips tend to use less power than the larger counterparts, even though they use the same quantity of macro cells. I'll add more detailed information on the changes in its own readme.

When the Atmel part is confirmed working, I'll update the rest of the readme to walk though programming those. Ideally the PCB could use a revision to add the FRAM mode jumper and a jumper to bypass the 3.3v regulator when using the MAX7000 and ATF15xx chips. Again, I'll get to that when testing is complete.

Firmware Versions

VersionStatusNotes
V1.0.0InitialOriginal code from Alex's blog
V1.0.1FixRemoved internal FRAM chip select logic to lower cartridge power consumption 1 to 3%
V2.0.0FixChanged project compiler settings to lower cartridge power consumption 36 to 41%
V3.0.0CurrentAI helper to teach me and structure code better. Use of macro cells more efficient. Logic split into smaller sections. More reliable, cleaner code, better output waveforms (I need to confirm that).

🩷 Links

🔧 Driver Install: https://www.terasic.com.tw/wiki/Intel_USB_Blaster_Driver_Installation_Instructions
⬇️ Driver Download: https://github.com/sudhamshu091/USB-Blaster-Driver-for-DE10-lite
🖨️ Game gear Adaptor: https://www.thingiverse.com/thing:5830799
⏬ Alt Link Quartus: https://archive.org/details/quartus-iiprogrammer-and-signal-tap-ii-13.1.0.162.7z
🛍️ Inside Gadgets Shop: https://shop.insidegadgets.com
📎 Inside Gadgets GitHub: https://github.com/insidegadgets
📷 Inside Gadgets Insta: https://www.instagram.com/inside.gadgets
🖇️ Bytendo Mods GitHub: https://github.com/bytendomods
🐭 Bucket Mouse: https://github.com/Bucket-Mouse
🛒 Natalie Shop: https://nataliethenerd.com/
🤓 Natalie GitHub: https://github.com/natalie-lang/natalie

Thanks to Xukkorz, Drew, Jamo, Alex, Deceptive Thinker, Natalie the Nerd & anyone else who I may have forgotten.

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.

Parts

23
QtyValueFootprintReferences
4100nFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C2, C4, C6
21uFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC3, C5
110KResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1
129F016Package_SO:TSOP-I-48_18.4x12mm_P0.5mmU3
13032APackage_QFP:TQFP-44_10x10mm_P0.8mmU2
13v/5vJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP1
15VTestPoint:TestPoint_Pad_D1.0mmTP1
174LVC1G332Package_SO:TSOP-6_1.65x3.05mm_P0.95mmU5
1AP2127KPackage_TO_SOT_SMD:SOT-23-5U4
1Altera/AtmelJumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP2
1CartBusGAMEBOY:GameBoy_GamePak_DMG-09_P1.50mm_EdgeU?1
1Conn_01x06GAMEBOY:JTAG Cart Edge ConnectorJ1
1FM1808Package_SO:SOIC-28W_7.5x17.9mm_P1.27mmU1
1GNDTestPoint:TestPoint_Pad_D1.0mmTP3
1TCKTestPoint:TestPoint_Pad_D1.0mmTP7
1TDITestPoint:TestPoint_Pad_D1.0mmTP4
1TDOTestPoint:TestPoint_Pad_D1.0mmTP5
1TMSTestPoint:TestPoint_Pad_D1.0mmTP6
1VCCTestPoint:TestPoint_Pad_D1.0mmTP2

Similar boards

  • 2 layers51 × 61 mmGameboy MBC5 Cart + FRAM DUAL 2MB, the printed circuit board in 3D

    Gameboy MBC5 Cart + FRAM DUAL 2MB

    sillyhatday/GAMEBOY-MBC5-DUAL-4_8MB

    A working 8MB flash cart. You can also use this to to make a 4MB cart out of cheaper 2MB chips.

    18 parts12CC-BY-SA-4.0
  • 2 layers100 × 100 mmMemory, the printed circuit board in 3D

    Memory

    crankery/crank68

    One day I thought to myself I want to build a computer with the simplest 8 bit CPU I can think of". That CPU is the Motorola M6800 and this is the computer.

    19 partsMIT
  • 4 layers110.7 × 69.8 mmSgb mbc5 1-4, the printed circuit board in 3D

    Sgb mbc5 1-4

    MouseBiteLabs/Super-Game-Boy-Plus

    A replacement circuit board for improving the Super Game Boy, or for creating a standalone Game Boy game for the SNES.

    95 parts41CC-BY-SA-4.0
  • 4 layersMosfets, the printed circuit board in 3D

    Mosfets

    abd-alaj/BLDC-motor-custom-inverter

    Matlab, Simulink, Hardware and C-code for a custom inverter project.

    139 parts1
  • 4 layers100 × 100 mmAlu, the printed circuit board in 3D

    Alu

    bcrist/vera

    Homebrew discrete logic CPU

    102 parts1MIT
  • 2 layers100 × 100 mmAS NES Mapper474-SM1, the printed circuit board in 3D

    AS NES Mapper474-SM1

    Akerasoft/AS-NROM-368

    Mapper 474 - Submapper 1 - NROM-368

    17 parts
  • 2 layersController, the printed circuit board in 3D

    Controller

    danielhufnagle/NURC-UROV-2026-2027

    Electrical and Software for MATE UROV 2026-2027

    20 parts

Questions

How big is the Gameboy CPLD Cart + FRAM PCB?

It measures 51 × 61 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Gameboy CPLD Cart + FRAM use?

23 parts, built around the 74LVC1G332GV and FM1808B-PG. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Gameboy CPLD Cart + FRAM KiCad files?

From the sillyhatday/GAMEBOY-CPLD-FRAM-2MB repository on GitHub, at the commit this page was made from: the board is KICAD/Gameboy CPLD Cart + FRAM.kicad_pcb and its schematic KICAD/Gameboy CPLD Cart + FRAM.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Gameboy CPLD Cart + FRAM design in my own project?

Its repository publishes it under the CC-BY-SA-4.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).