Close
0%
0%

Game Boy Advance Bluetooth HID

Turn your Game Boy Advance into a Bluetooth Gamepad

Public Chat
Similar projects worth following
Use a Gameboy Advance as a Bluetooth Gamepad to play your favorite games on emulators running on PC, Android, Mac or any Bluetooth compatible device

The device is basically an ESP32 connected to the GBA through the link port. With the device connected and without any cartridge inserted in the GBA, once the GBA turns on the ESP32 sends a small rom to be loaded in the GBA. This rom is a program made to enable communication between the ESP32 and GBA for both handling bluetooth connection and sending the user input to the ESP32 when it is connected to a bluetooth host and act as a gamepad. Unfortunately it only works with traditional GBA and I couldn't make it work with GBA SP. I think GBA SP just doesn't give enough power.

When turned on the ESP32 performs a multiboot sequence through the SPI to the GBA sending a rom that the ESP32 has stored in the flash memory. Once loaded the ESP32 enables the UART port in the same pins and the rom communicates with the ESP32 using UART through the link port.

The ESP32 is powered by the 3.3V the GBA gives through the port

---------------------------------------------------------------------------------------------------------

Previous version of this project used an Atmega and an HC-05. This is the description for that prototype:
A GBA program that uses the link port to communicate with a HC-05 bluetooth module using UART (HC-05 flashed with RN-42 firmware, find how to do it in the links at the bottom).

This rom is stored in a W25Q32 flash chip. An Atmega328P performs a multiboot sequence reading from this chip and sending to the GBA through the link port.

Once multiboot ends, the gba program runs and talks to the HC-05 to handle bluetooth connection, and key presses.

Additional 74XX157 quad 2-input multiplexer makes possible to multiplex SPI to read from the flash chip and send the multiboot, it alternates byte reads from the flash chip and send them to the GBA. Then using hcf4066 switch link port pins are switched from the spi to the HC-05 uart pins.

The whole circuit runs at 3.3V provided by GBA through the link port.

Final version of the circuit includes a 6 pin port that allows to reprogram the atmega if necessary. Also it lets to turn the atmega into a special write mode to reprogram the flash memory.

  • 1 × ESP32 WROOM
  • 1 × GBA link port male connector easy to get from GBA-GC cables knock-off found out there
  • 1 × (Recommended) GBA-GC knock-off adapter case
  • 1 × Some electrical tape

  • Migration to ESP32 and build instructions

    Shyri Villar04/12/2020 at 17:28 0 comments

    After a long time I was able to migrate the whole project to ESP32. I wanted to do this mainly to make it fit into a small case. I used one of those GBA-GC third party cables to take the case and the link port connector. So now the project works just with an ESP32 connected to the link port and everything fits into a small case.

    I also published all the instructions to build the adapter.

View project log

  • 1
    Program the ESP32

    Start programming your ESP32-WROOM with the firmware you can find here:

    https://github.com/Shyri/gba-bt-hid/tree/master/esp32

    I recommend to use one this programmers:

    This project was tested with ESP-IDF v3.3.2 that you can find here:

    https://github.com/espressif/esp-idf/releases

    You also will need to install btstack. Commit https://github.com/bluekitchen/btstack/commit/a0a4507b35ea396d076a62a67efb1a5a800c5ff9 is the most recent version that is proved to work in this project.

    Just follow the ESP32 environment instructions here

    https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/

    Plug the ESP32 into the programmer. Plug the programer to the pc. Get to the code directory and run 'make flash'

  • 2
    Getting the link port connector

    I recommend to buy one of this GBA-GC cables knock off they sell.

    They will provide both a link port connector plus a case where you will house the device and will attach nicely into your GBA.

    Disassembling it and desolder the link port connector. Be careful here and don't rush, the connector is mainly made of plastic and if you lay the soldering iron for too long it will start to melt and it wont plug correctly into your GBA later. 

  • 3
    Cut a small PCB

    You may have notice the PCB that comes in the GBA-GC adapter has a special shape so that the connector doesn't come off the case whenever you pull the adapter from the top of the GBA. To make the same thing I cut I piece of perfboard with this sizes:

    You can use the wholes as a reference if you don't want to take out the ruler to measure. Now we need to stick the link port connector to the leg that is three holes in width. In the diagram above you would place the connector in the left leg and the bottom of the connector would point outwards the screen. Keep in mind that wholes connect both sides of the perfboard and we don't want to short the link port pins. What I did was soldering the pins of one side of the connector to the first row of holes, and on the other side solder the other three pins to the second row of holes trying to avoid contact with the first row. Little rough but it works.

    There... this will stop the connector from popping out of the case and at the same time will make easier to solder cables later.

View all 6 instructions

Enjoy this project?

Share

Discussions

Dan Krause wrote 06/14/2020 at 20:57 point

This is a great project - I've been wanting to build something similar that would use an ESP8266 to multi-boot a ROM that can read SAV and ROM data from an inserted game cart. I might just use your code on github to bootstrap this effort.

There is one risk when directly connecting a bare ESP32 module to a GBA link port. When a GB or GBC cart is in the console, the console runs on 5V rather than 3.3. There's a physical switch in the cartridge slot that is actuated by GB and GBC carts. GBA carts have a slightly different shape that is designed to avoid actuating this switch.

If you plug your device into a GBA with a GB or GBC cart inserted and power it on, you'll fry your ESP32 module. Putting a voltage regulator or over-voltage protection circuit between the ESP32 and the link cable would prevent this. The ESP32 has been proven to be 5V tolerant on it's logic pins, but it can't be powered with 5V.

So, to anyone who is thinking of assembling this device as described here - just make sure you don't power it on with an old cart in your console.

  Are you sure? yes | no

KennyKen wrote 04/26/2020 at 11:35 point

Hey there, this sure looks awesome! I tried to build one today but I fail miserably whilst compiling under Linux (Ubuntu). the make process failed a lot because I was missing the whole btstack library. After downloading and including it, it now crashes at this point:

/home/kenny/gba/gba-bt-hid/esp32/main/gap.h:47:10: fatal error: classic/btstack_link_key_db.h: No such file or directory 
#include "classic/btstack_link_key_db.h" 

The btstack library does not contain any file named like this (btstack_link_key_db.h). Did I miss something or do I need some other dependencies / libraries? Thanks in advance!

  Are you sure? yes | no

giltesa wrote 04/22/2020 at 06:32 point

The project is awesome, but I think it would be a better idea to use the GBA wireless adapter, the case is a little bit bigger than the GC adapter, so you can make a PCB and soldering all components on the board.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates