Quick Navigation All projects Hardware Links Top 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 GitHub AlanFromJapan Contact me Who'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 terminalLast update: Thu May 23 11:58:57 2024
See my other Gameboy related pagesHey, 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! PresentationPrincipleUsing 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 interrestImplementationMCU, pins and interruptsI 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 materialsSchematicsPinout of the male connector of a GBA-GBCColor Source codePicturesLinksHelpful sourcesInspiration |
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]) |