Skip to the content
4 layers18.2 × 18.3 mmGBA mem, the printed circuit board in 3D

Game Boy Advance faster EWRAM hack

Size
18.2 × 18.3 mm
Copper layers
4
Thickness
1.6 mm
Parts
2
Nets
47
Pads
92
Tracks, vias
321, 44
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
22 Jun 2021
Updated
30 May 2022

Overview

GBA mem is an open-source printed circuit board by HorstBaerbel, from the HorstBaerbel/GBA-mem repository on GitHub, published under the MIT licence. It is a 4-layer board of 18.2 × 18.3 mm with 2 parts on 47 nets, routed with 321 tracks and 44 vias.

It is built around the IS62WV12816EBLL-45TLI. It belongs with the retro computing and games boards of this library.

Main components

1

README

README.md

Here be dragons🐉!
This killed my GBA. I probably fried the power supply IC. I'm leaving this here for academic purposes...

Game Boy Advance faster EWRAM hack

The GBA has 256kB of external work RAM in the form of an 128kx16 SRAM chip with 70ns (M68AS128DL70N6), 85ns (μPD442012AGY-BB85X-MJH), or even 120ns (HY62LF16206A-LT12C) access time, depending on the chip (good hardware database here). The regular EWRAM access speed is 2 wait states (3/3/6 clock cycles) for 1/2/4 bytes of data. Setting the undocumented EWRAM wait states flags to 0Eh allows you to speed up EWRAM access to 1 wait state (2/2/4 clock cycles). Setting it to 0Fh will crash / lock up the GBA though, because 0 wait states are out of the specs of all SRAM chips ever used in the GBA / GBA SP and GBA Micro (access times must be < 62ns) and EWRAM gets corrupted (see testing memory). The choice of those SRAM chips back in 2000 was probably due availability and keeping the system costs down, but 20 years later there are cheap SRAM chips available with as low as 10ns access time, so...

The hardware

This aims to replace the GBAs SRAM chip with a faster chip on a carrier board, because there seem to be no pin-compatible models anymore. The old models used a TSOP-I-48 footprint, newer models use a TSOP-II-44 footprint and all have a very different pinout.

All pins have been connected straight through, with the exception of /CS1 (/CE1) and CS2 (CE2) which are permanently connected to GND resp. VDD2 / 2.5V anyway according to GBATEK. Also the upper byte lines (D8-D15) are swapped for better chip placement.

Supposedly compatible SRAM chips for the board:

Modelmin. access timemax. power drawworking
IS62WV12816BLL-55TLI / -55BLI55ns~25mANO (tested)
IS62WV12816EBLL-45TLI45ns~15mA?
CY62136FV30LL-45ZSXIT / -45ZSXI / -45ZSXA45ns~18mA?
CY62136ESL-45ZSXI45ns~20mA?

The power draw of the replacement chips seems to be comparable to that of the originals. I'd go with the IS62WV12816EBLL-45TLI if you can find it, because of the lowest power draw.

Making your own boards

The KiCad directory contains the schematics and PCB layout and also gerber files (exported for JLPCB). I chose JLPCB as a manufacturer in this case and a board thickness of 0.8mm. Remember to get a stencil made for both sides.

Soldering

I opted for ChipQuik Sn42/Bi58 TS391LT solder paste because of its low melting point of 138°C. This makes it easier to solder and you need to heat up the GBA mainboard less. You can 3D-print a PCB holder for the PCB to apply solder paste with the stencil:

Testing memory

You can use the MemTestGBA binary to test stability and performance (on a REAL AGB/AGS Game Boy Advance, NOT on the DS / DS lite or a GBA micro):

It will test the ROM read, EWRAM read / write and IWRAM ⟷ EWRAM copy speed (startup default, Button A). Memory is copied in 24kB blocks, so this is not the max. speed possible, but gives a ballpark number. You can also test the memory for errors (Memtest86+-like, Button B). Buttons L and R let you increase or decrease the EWRAM timings, ⟵ and ⟶ let you increase or decrease the ROM wait states and START reboots the GBA. The source code can be found in the src directory.
Theoretical EWRAM SRAM chip transfer speeds should be: Clock speed * 2 (16 bit SRAM width) / (1 + wait states) ⟷ 16 * 1024 * 1024 * 2 / (1 + w) = 10.6 MB/s (default 2 wait states) and 32 MB/s (0 wait states).

How to build the test binary?

From the command line

sh
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j $(grep -c '^processor' /proc/cpuinfo 2>/dev/null)

From Visual Studio Code

  • You must have CMake, devkitPro / devKitARM r54 or higher installed.
  • Must: Install the "C/C++ extension" by Microsoft.
  • Recommended: If you want intellisense functionality install the "C++ intellisense" extension by austin.
  • Must: Install the "CMake Tools" extension by Microsoft.
  • Restart / Reload Visual Studio Code if you have installed extensions.
  • Open the GBAmem folder using "Open folder...".
  • Choose "Unspecified" as your active CMake kit if asked. It then should be autodetected correctly.
  • You should be able to build now using F7 and build + run using F5.

License

If you want to build your own soft- or hardware based on this, you can. See the MIT LICENSE.
The "Modern DOS" 8x8 font is from Jayvee Enaguas and used by CC0.
The CMake build scripts / toolchain is from Thomas Farr and uses the MIT LICENSE.

Todo

  • Move all of the code to IWRAM
  • Use framework
  • Test IS62WV12816EBLL-45TLI
  • Try out AGZ PCB

Parts

2
QtyValueFootprintReferences
1HY62LF16206A-LT12CHY62LF16206A-LT12C:HY62LF16206A-LT12C_TSOP-I-48_12x18mm_FlipU1
1IS62WV12816EBLL-45TLIIS62WV12816EBLL-45TLI:SOP80P1176X120-44NIC1

Similar boards

  • 4 layers25 × 35 mmQfn csi underpad diff, the printed circuit board in 3D

    Qfn csi underpad diff

    drandyhaas/KiCadRoutingTools

    A set of Python/Rust tools to aid routing in KiCad

    2 parts744MIT
  • 4 layers25.7 × 13 mmCpw test, the printed circuit board in 3D

    Cpw test

    loxodes/vna

    Under development open hardware microwave vector network analyzer

    2 parts205
  • 4 layers54 × 16 mmBnc test, the printed circuit board in 3D

    Bnc test

    azonenberg/starshipraider

    Open hardware test equipment

    2 parts193BSD-3-Clause
  • 4 layers94 × 53.4 mmMegaProgrammer, the printed circuit board in 3D

    MegaProgrammer

    clydeshaffer/gametank

    design files for the gametank hardware implementation

    2 parts150
  • 4 layers90.2 × 55.9 mmArduinox86 486 shield, the printed circuit board in 3D

    Arduinox86 486 shield

    dbalsom/arduinoX86

    An interface between an Arduino Due or Arduino GIGA and 8088, 8086, V20, V30, 186 or 286 CPUs

    2 parts114
  • 4 layers45.3 × 11.8 mmIdeswap, the printed circuit board in 3D

    Ideswap

    agranlund/raven

    Homemade MC68060 + DSP56303 Atari-compatible computer. Hardware, firmware, and software stack

    2 parts87
  • 4 layers39.4 × 53.3 mmSAB To RPi, the printed circuit board in 3D

    SAB To RPi

    whollender/SuperAudioBoard

    High quality, 24-bit audio codec board for Teensy 3.x

    2 parts75
  • 4 layers99.7 × 13 mmE Field 10cm, the printed circuit board in 3D

    E Field 10cm

    imendizabal/Near-Field-Probes

    Open Source kit of Near Field Probes for Electromagnetic Compatibility (EMC) troubleshooting

    2 parts59GPL-3.0

Questions

How big is the GBA mem PCB?

It measures 18.2 × 18.3 mm and has 4 copper layers, 1.6 mm thick.

What parts does the GBA mem use?

2 parts, built around the IS62WV12816EBLL-45TLI. 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 GBA mem KiCad files?

From the HorstBaerbel/GBA-mem repository on GitHub, at the commit this page was made from: the board is KiCad/GBAmem.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the GBA mem design in my own project?

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