Close

Hardware Overview

A project log for 2019 Hackaday Superconference Badge

FPGA Running RISC-V Core in a Game Boy form factor

LutetiumLutetium 11/04/2019 at 05:510 Comments

Accessing Hardware from Userspace

The most comprehensive and up-to-date documentation on hardware registers is found in the mach_defines.h file. Here is the cartridge I/O info from that file:

/** General I/O input register. Bits 29-0 reflect the values of the corresponding lines on the cartridge I/O connector. */
#define MISC_GENIO_IN_REG (17*4)
/** General I/O output register. Bits 29-0 set the values of the cartridge lines that are selected as outputs. */
#define MISC_GENIO_OUT_REG (18*4)
/** General I/O output enable registers. Set 1 to any of the bits 29-0 to make the corresponding line into an output. */
#define MISC_GENIO_OE_REG (19*4)
/** Write 1 to set register. Any write of 1 will set the corresponding bit in MISC_GENIO_OUT_REG to 1. */
#define MISC_GENIO_W2S_REG (20*4)
/** Write 1 to clear register. Any write of 1 will set the corresponding bit in MISC_GENIO_OUT_REG to 0. */
#define MISC_GENIO_W2C_REG (21*4)
/** Extended I/O input register. The bits here reflect the values of the corresponding lines on the cartridge I/O connector:
   (ToDo: insert mapping here)
   Bit 31 reflects the status of the input-only USB VDET line, which is high when a +5V voltage is on the USB VBUS line.
    */

Cartridges

You will find the cartridge specification here: https://github.com/Spritetm/hadbadge2019_protoboard

For ease of use, here are images of the board and schematic:

Discussions