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 serial terminal

Last update: Thu May 23 11:58:57 2024
nintendo-game-boy-icon.pngSee my other Gameboy related pages
Hey, early 2024 I (finally!) managed to transform a GameBoy into something useless : a GameBoy Clock! Couldn't I turn the same hardware in another useless project: a serial terminal? A /dev/ttyxxxx that would show stuffs? Useless, yes. Intellectually stimulating, oh yes!

Presentation

Principle

Using V-USB, enumerate on the PC as a serial port /dev/ttyxxx so you can connect to it like any serial device and send text. The MCU on the board would bufferize and communicate with the GB via Link port (serial also) to show the text...

Points of interrest

  • Enumerating as a Serial port, doesn't seem that common. Found one project though, so let's try http://www.recursion.jp/prose/avrcdc/download.html
  • Small foot print (as much as reasonable)
  • Made to reuse the GBA connector from a GBA Wireless adapter
  • Smallest MCU possible: thinking atTiny85
  • Implementation

    MCU, pins and interrupts

    I want a small board so a small MCU (~= low pin counts): need 2 for USB, 2 for the GB interface (CLK + S_DATA_OUT), maybe a "Reset" button. Total 5 pins. I can fit that in a AtTiny85 which has plenty of Flash/RAM to accomodate V-USB (need 2k+ Flash and 128B RAM).
    But it means I have to sacrifice the 2 clock pins and calibrate the internal oscillator. Luckily there is a sample by Adafruit (thanks!). So pins will be tight but sufficient

    Now the question: can the interrupt for the USB play nice with the interrupt from the GB? Answer is without even trying: "most likely no". I thought of a few options like not using interrupt for the GB communication and let be interrupted by the GB, using another MCU that would share data via a shared flash, ... But there's really no problem in fact: the GB just need to receive data, not to send anything to the board. And the GB can be driven by an external clock that can be as fast/slow as needed and does not even need to be regular. Just put the right data on S_DATA_OUT on the right clock edge and you're in!
    So no interrupt for sending to GB: infinite loop that pulls whatever is in the memory buffer to the GB, while the USB as interrupt stores the incoming characters.

    Bill of materials

    Schematics


    Pinout of the male connector of a GBA-GBCColor

    Source code

    Pictures

    Links

    Helpful sources

    Inspiration

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