navigationGo.pngQuick Navigation
allprojects32.pngAll projects
hardware32.pngHardware
links32.pngLinks

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
WordClock
ardReveil v3
SNES Arcade cabinet
Game boy projects
cameleon
Home Presence Detector

github32.pngGitHub
AlanFromJapan

navigationMail.pngContact me

alanfjmail.png
3flags.pngWho's Alan?


Akizukidenshi
Elec-lab
Rand Nerd Tut
EEVblog
SpritesMods
AvrFreaks
Gameboy Dev
FLOZz' blog
Switch-science
Sparkfun
Suzusho
Datasheet Lib
Reddit Elec
Ermicro
Carnet du maker (fr)

Gameboy homebrew cartridge

Last update: Tue Jul 7 22:13:11 2020
nintendo-game-boy-icon.pngSee my other Gameboy related pages

Introduction

This is a Gameboy original cartridge with a flash memory store homebrew games. I have no idea is you can put ROMs of commercial games on and I have no interrest in finding out. This is to be used by your unique creations, well, mine in fact :)

There will be multiple versions of that board, will be created in that order:
  • The modest × Mixed results: just holds the flash and a microcontroller used to upload the flash without a special programmer (which I don't have anyway)
  • The revenge working (with a few airwire): just took what I found on the net and mess-up a few things
  • The victory working on GBC but not DMG/Pocket: basically mending my hurt pride.
  • The DeLuxe (future plan): this time the mCU will sometime steal the spotlights and answer to the GB instead of the flash. Mainly idea is to use the mCU to read a RTC and return time, that's all: making your Gameboy clock.



Ultima version - June 2020

Euh ... why? Seriously. You are fixating.

Yeah well, I want to make one board that works fine. And a gentleman on gbdev forums suggested that I add a switch to hold multiple game at once, and I find the idea splendid! So let's do it: take the Victory, fix the bug and add that switch!

Fast forward a few weeks: and this works just fine! You can solder close the bridges to just use it as a 32kB ROM OR use the switchs (3 bits) to access one of the 8 programmed 32kB ROMs. To do the latest, concatenate the 32kB ROMs in one file and burnt it on the EEPROM.
→ The code is here on GitHub (pick the "ULTIMA" one)



Victory version - May 2020

It works, with 1 airwire as a 32kB cartridge. I redid everything from scratch on this one and did hand routing (a great activity I recommend for passing time, it's like Tetris), but still have 1 issue I didn't forecast.

Euh ... why? Seriously.

Because the Revenge below is "ok" (well, it can be made to work) but I made a few mistakes I'd like to fix, to make a """prefect""" cartridge (for me).

  • Worked out of the box (May 2020) ... on GB Color only, but not on GB DMG or Pocket. On the 2 later it is recognized (proper Nintendo logo) but after the screen blanks.
  • Solution (thanks to the guys of gbdev forum is that A15 of the cartridge must be connected to EEPROM's /CE (on this version /CE is grounded). On my version it's the only control pin I left without a 2 way solder switch, so you have to cut a trace and airwire the EEPROM pin to the A15 pad.

  • The code is here on GitHub (pick the "victory" one)

  • How it's wired (cartridge -> EEPROM):
    Cartridge EEPROM Comment
    A0-A14 A0-A14
    A15 GND EEPROM is tied to GND, but can be connected to cartridge via solderbridge WRONG! Cartridge A15 must be connected to /CE (pin 22) of the EEPROM

    A16-A17 Both tied to GND
    D0-D7 D0-D7
    Clock
    unused
    /WR VCC EEPROM is tied to VCC, but can be connected to cartridge via solderbridge
    /RD /OE
    /CS GND EEPROM is tied to GND (always enabled)WRONG! Cartridge /CS can be left unconnected but A15 must be connected to /CE (pin 22) of the EEPROM
    Reset VCC EEPROM is tied to VCC, but can be connected to cartridge via solderbridge
    Audio in
    Ignored (no 47kOhm resistor but can be airwired)
    VCC VCC
    GND GND




    Revenge version - April 2020

    It works, with a few airwires or solder-blobs, as a 32kB cartridge. This is based on that gentleman work, credits go to him (though I think he might have some of the same issues).

    Euh ... why?

    5 years ago (now 2020Q2) I made the modest and it failed. Tried again, and it DOES work (see below for details). However you can't read a game with it in a GameBoy. So I found on the net the below versions that look simple enough that I can "inspire" (read "rip off") and make the same. Will cost me about the same but if it works I'll have 10 cards and not 1. And if it still fails, I'll have learned a few things.

    So I decided to not reinvent the wheel: indeed I found this (its 32kB version), which I thought I could use a base until I found I would do no major change... so since I couldn't send to production someone else's job without messing it up, I spend a few hours moving things around, fixing what I thought needed to be fixed, and there, sent to production.
    Everything is on my fork of his project, in the "32kB-variant" branch.




    Verdict?

    It works v(^_^)v but there's a few issues:
  • If you put a DMG chip it might not work, or at least make sure to not close the /RESET solder jumper (didn't try much, not needed)


  • From that point I consider you just use the EEPROM in PLCC32 format:
  • Leave the "/RESET" jumper open: if you close it grounds it, and a chip permanently in Reset mode is useless ...
  • Instead, join PLCC pin 1 = /RESET (top-middle) to pin32 = VCC (on its right) via solder blob or air wire
  • Do the same to pin 31 = /WE to pin 32 = VCC, to avoid leaving it floating as a hygiene measure
  • Close the A17, A16, A14 solder jumper (Connect them to the board connector)
  • A15 and /CE are connected, I don't know why, didn't thought much of it initially. Make your life easier. Leave A15 jumper open. Then for /CE: on the underside (why in the f*cking hell I put this jumper on the back?) CUT the small jumper wire and solder the jump middle to the other side (GND)

  • That's a bit ugly but it works now. Enjoy!

    Improvements

  • DON'T put solder pad on the back
  • Trash that DMG1 chip footprint, it should be a vanila 32kB cartridge that's all
  • DON'T have that A15 to ground: should be to the A15 connector pad
  • Wire /RESET and /WE to VCC
  • Wire /CE to GND
  • Add a silk for the jumpers
  • Add some more test pads for at least VCC, GND and the command signals (NOT address nor data)
  • Add a mark that the board should be 1.0-1.2mm thick (not the usual 1.6mm)
  • Add an alternate 1206 solder pad footprint for the decoupling cap
  • Make sure the Gameboy logo is on the board



  • Modest version (a PLCC32 EEPROM programmer)

    This is a half-success/half-failure: it does not work as a GB cartridge (it might, but the form factor is failed so can't even plug it), but it does work fine as an PLCC32 EEPROM programmer! Use this program to drive it from your PC read/write EEPROMs.
    2015-02-17-23-23-02_deco.jpgNo real time answering instead of the flash memory: just program or even skip the mCU entirely and just put the flash.

    Parts


    Schematics

    See on my Github.

    README:
    • Gameboy game port expects a 2-2.1mm thick board so
      • do that PCB 2mm thick, or
      • do it 0.6mm and you stick it in a existing cartridge or
      • (my current option) you make board 1mm thick, cut out the connector part of a spare board and glue/doubleface tape them: your connector part will be 2mm which should make your GB happy
    • Card was mostly autorouted with very thin signals 0.1524 wires. It works but signals are easily damaged by a hot iron or a careless tinkerer. Be careful.
    • Autorouted 'cause I'm lazy, but result is ok (at least it works)
    • I should stop trying putting a gnd mask everywhere, it's a risk with such thin wires
    • Stop using too small font: all the 0.6 font were just not printed, resulting in a blank pcb
    • Next time don't put wires below the insertion pads, friction will kill them (one day)
    • Next time have an option to just solder the flash, not use the socket: it's too thick and don't fit in a GB
    • Could have done that with a smaller 88a for instance, with a SIPO to address the need of pins (cheaper, easier to source, and less waste of power)

    Code

    EEPROM programmer at work On my GitHub.

    Fuses

    ATmega64a are tricky little b*stards and letting a fuse set cost me 2 weeks of time.
    You must unset JTAGEN (or pins PF4-PF8 won't be generic I/O) and unset CompMode. For the clock I picked EXTHIFXTALRES_1KCK_0MS: I run the mCU with a 16MHz crystal, the max speed for this model.

    Here's what you should set:
    • Extended: 0xFF
    • High: 0xD9
    • Low: 0xEE



    Documentation


    Things I'd like to copy:
  • The regular 32kB card
  • The fancy switchable one
  • Oh another promising tutorial http://gameboy.mongenel.com/asmschool.html
    Good tutorial on the card making and z80 http://www.digital-circuitry.com/8-bit_Memory_Mapping.htm

    Internal

    External

    Hackaday :

    GBPins.gifgb_cartridgeeprom.gif
    All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated)
    electrogeek.cc ~ Formerly known as Kalshagar.wikispaces.com (AlanFromJapan [2009 - 2020])