3D games console based on RP2040 and iCE40 UP5k

Related tags

Game PicoStation3D
Overview

PicoStation 3D

Top view of board, showing an RP2040 microcontroller, iCE40 UP5k FPGA, 8MB HyperRAM, HDMI socket, micro SD receptacle, audio jack, two SNES controller ports, micro USB for power + data.

This is an unfinished, untested project to develop a 3D games console based on an RP2040 microcontroller and an iCE40 UP5k FPGA. Quick links:

From left to right, the components on the top edge are:

  • A 3.5mm TRS audio jack, connected straight to RP2040 GPIOs via an RC filter (no separate audio supply on this board rev)
  • A status LED for the RP2040
  • A micro SD receptacle connected to the RP2040
  • A micro USB socket providing power to the board, and code download and serial comms via the RP2040
  • A status LED for the FPGA
  • An HDMI socket for DVI-D video output, connected to the FPGA

The bottom edge has two SNES controller sockets. Also on the board is an 8MiB HyperRAM connected to the FPGA.

There is a RESET and BOOTSEL button for the RP2040, for quick firmware updates over USB, but the debug header (UART + SWD) is a better solution for iterating and developing code.

There are 12 wires connecting the FPGA to the microcontroller, one of them going from a GPOUT clock output on the RP2040 to a GB_IN global clock input pin on the UP5k. The intention is to use these for an 8 bit parallel bus with a free-running clock, a valid-ready handshake and an IRQ line, and for the UP5k to derive its internal clocks from the bus clock. This interface overlaps with the pins required to load the FPGA's internal configuration memory (and the RP2040 also has control of the UP5k's reset) so there is no separate external flash required for the UP5k.

Board Use Cases

  • Run everything, including graphics routines, on RP2040, and use the UP5k as a parallel to DVI-D bridge -- see here for a quick demo of some scanline blitting on RP2040

  • Run everything, including a soft processor, on the UP5k, and use RP2040 as a surprisingly cost-effective USB-serial bridge, as well as for firmware upload. You'll need some kind of shell running on the RP2040 to provide audio and controller port access from the FPGA

  • Run game logic, audio, controller access and SD card access on RP2040, put all the graphics hardware in the UP5k (with the local 8MB HyperRAM as VRAM, plus the UP5k's internal 128k SPRAM)

  • Run 3D vertex-side operations on RP2040, and put 3D fragment-side hardware on the FPGA

Project Status

I've laid out a first iteration of the board, and have soldered up a prototype, but haven't had the chance to bring up the board or write any firmware, thanks to being a bit overloaded with the launch of RP2040 itself!

Front view of a prototype board, showing the two SNES controller connectors soldered to the front

Top detail of a prototype board, showing the RP2040 microcontroller, iCE40 UP5k FPGA, and HyperRAM. The controller ports are labelled player 0 and player 1.

Rear view of a prototype board, showing left to right the HDMI socket, FPGA LED, USB socket, SD card slot, microcontroller LED, and audio jack.

There are questionable decisions in the schematic (in particular the power chain violates the UP5k's sequencing requirements) so you shouldn't copy what you see here, but I'm posting this anyway because it might inspire somebody to make something better, and that is more important than me being embarrassed about my shoddy design work.

You can find a proof of concept for direct DVI output from a UP5k FPGA in this repo.

I've also managed to squeeze RISCBoy plus a DVI output onto a UP5k. Still need to push that code but you can see a video of it I tweeted. This shows you can fit plenty of interesting graphics hardware (and in this case a RISC-V processor) into a UP5k whilst generating DVI-D signals.

Known issues with rev A:

  • Digital supply noise is audible through the audio jack. This could be improved by a separate LDO'd audio supply with a dual logic buffer, or just by deleting this output and doing digital audio through the video connector on the FPGA.
  • The FPGA core supply comes from RP2040's LDO, to try and keep part count to an absolute minimum. This gives a fast ramp to 1.1 V shortly after the 3.3 V IO supply comes up, and a second ramp to 1.2 V some milliseconds later when software adjusts RP2040's core regulator. This is all quite questionable, and part of the point of Rev A is to find out whether I can get away with this.
  • The controllers are only accessible from RP2040, not the FPGA. This is not a huge issue, but it would be more fun as an FPGA platform if they were moved to the FPGA, or perhaps even make the CLK and LAT line open-drain, and connect the controllers to both FPGA and RP2040.
  • There is no separate configuration flash for the FPGA. Instead the microcontroller stores the bitstream in its flash, and writes this into the FPGA's configuration memory at boot. This should work fine but it's a less familiar development flow for those using this as an FPGA board, and it might be nice for pure-FPGA games consoles to have some local flash to access. Again, I'm trying to see how little hardware I can get away with, and this might have been a misstep.
  • The SNES controller sockets are transposed left-to-right compared with an actual SNES.
  • Double-sided component load makes it annoying to reflow this board at home, and adds cost if you want to get it PCBA'd.

If you have read all the way to the end and you have spotted something else that irritates you about this design, please raise an issue! It will be a while until I get to Rev B. The main purpose of Rev A was to explore what I could get away with, and to develop the comms and interactions between microcontroller and FPGA.

You might also like...
A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.
A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.

Jolt Physics Library A multi core friendly rigid body physics and collision detection library suitable for games and VR applications. A YouTube video

Distributed server for social and realtime games and apps.
Distributed server for social and realtime games and apps.

Distributed server for social and realtime games and apps. Features Users - Register/login new users via social networks, email, or device ID. Storage

A set of libraries and tools to make MSX games using the C programming language.

ubox MSX lib This is a set of libraries and tools to make MSX games using the C programming language. There are three main components: ubox: thin wrap

TIC-80 is a fantasy computer for making, playing and sharing tiny games.
TIC-80 is a fantasy computer for making, playing and sharing tiny games.

TIC-80 is a fantasy computer for making, playing and sharing tiny games.

Enfusion Artifical Intelligence for DayZ and future Bohemia Interactive games.

Enfusion AI Project (eAI) This mod adds headless player units under the control of a script on the server. Although the script is very rudimentary now

Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.
Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Project DELTA - An open-source trainer built on the Void Engine for Toby Fox's games and their spin-offs.

Project DELTA v3 Project DELTA - An open-source, modular mod menu for Toby Fox's games and their spin-offs. Important note to Grossley: Yes, it is out

Graphical improvements mod for Hyperdimension Neptunia Re;Birth1, Re;Birth2 and Re;Birth3 games.
Graphical improvements mod for Hyperdimension Neptunia Re;Birth1, Re;Birth2 and Re;Birth3 games.

Neptastic Mod Graphical improvements mod for Hyperdimension Neptunia Re;Birth1, Re;Birth2 and Re;Birth3 games. Features: Resolution upscaling and down

Dragon's Dice Roller aims to be a lightweight, simple, reliable and easy-to-use dice roller for RPG games.

Dragon's Dice Roller is the first and (so far the only) open source RPG dice roller written in C available on GitHub. It aims to be a lightweight, simple, reliable and easy-to-use dice roller for any kind of role-playing game.

Comments
  • On possible GPU on FPGA variants

    On possible GPU on FPGA variants

    I like what you are planning to achieve with this project and from how I see it, this could serve as a way to determine what parts of similar project should stay on microcontroller or go to FPGA for desired results.

    Beyond that, I see something that might as well be spun off into its own project, and that is microcontroller-class GPU/HMI accelerator. Granted, there is now a few microcontrollers with 2D accelerators or VGLite GPU, but they are on an expensive side and are more specialized towards HMI.

    There are at least 3 ways I can see this idea going forward:

    • HMI "handler", drawing, displaying and responding to touch/physical controls, but only communicating with host when there is a need for information that's not present on flash chip storing code and assets for handler, or a command/information to that host inputted from using that HMI.
    • 2D GPU controlled in retained mode, maybe even using its own asset storage like HMI handler.
    • configurable GPU, that can have only what's required for a given application, driven with bitcode that only represents what was configured. I see a non-negligible possibility, that some configurations might only need something much smaller/cheaper than UP5K, maybe even cheaper than difference to neareast HMI-capable host chip.

    I see that you haven't posted here for past 10 months, and aside from throwing this far-fetched idea, I would like to encourage you to continue work on this project either way. In my opinion there are 2 ways in which next board revisions could be improved:

    • Wire one SNES controller socket to MCU, other to FPGA, then have almost all other components duplicated, so that you could have them wired in the same fashion, and be able to test different use cases and configurations without having to redesign and respin board.
    • Displace RP2040 with NXP i.MX RT106x (Teensy 4.x's chip). I understand that by doing so it won't be much of a PicoStation anymore, but then Pico still could act as the very flexible control and I/O processor, while Station will get much more performant core with 2D acceleration and dedicated video output AND input, allowing for even more possibilites for experimentation (e.g. early 3dfx Voodoo-style 3D acceleration in FPGA)
    opened by mardab 0
Owner
Luke Wren
Interests: C, Verilog, Python Dislikes: C, Verilog, Python
Luke Wren
This is a list of different open-source video games and commercial video games open-source remakes.

This is a list of different open-source video games and commercial video games open-source remakes.

Ivan Bobev 173 Jan 2, 2023
A game console based upon custom hardware.

handheld-game-console A handheld game console that has custom games. The base of the console is an ESP-WROOM-32 DEVKITV1. The display used is an ili94

Builder212 1 Jul 30, 2022
A Console Based Arithmetic Program/Game

Welcome to Operator Fill This is a console based MATH program/game made in C++ which in current stage has 700+ lines of code.(I have plans to make it

Asutosh Mishra 2 Jan 12, 2022
A tetris game on windows console written in C++.

TetrisConsole A tetris game on windows console written in C++. For Course de Introduction to Data Structure and Algorithm Analysis, BUPT 2021. Notice

Ellias Kiri Stuart 6 Jun 12, 2021
Using Astar 2d simple console game

Journey-to-a-astar About this game Astar 알고리즘을 변형하여 이용한 2D맵 게임입니다. 게임의 목표는 ★(a star)에 도달하는 것 입니다. 별을 지키는 적이 플레이어를 쫓아옵니다. 적에게 잡히지 않고 최대한 빠른시간안에 별에 도달하면

Minseob Kim 1 Dec 10, 2021
A Game Boy game that rewards you for playing it on several console models!

GB Corp. A Game Boy game for the Game Boy Competition 2021 by Dr. Ludos (2021) This is the source code, you can get a precompiled rom from here: https

Dr. Ludos 10 Sep 25, 2022
noclip is a single-header backend for a developer console

noclip Many computer games have a developer console or in-game console which provide a command-line interface for executing commands, changing game va

Kevin Chin 10 Oct 28, 2022
GlslViewer is a flexible console-base OpenGL Sandbox to display 2D/3D GLSL shaders without the need of an UI

GlslViewer is a flexible console-base OpenGL Sandbox to display 2D/3D GLSL shaders without the need of an UI

Patricio Gonzalez Vivo 3.8k Dec 26, 2022
TrenchBroom is a modern cross-platform level editor for Quake-engine based games.

TrenchBroom is a modern cross-platform level editor for Quake-engine based games.

TrenchBroom 1.3k Jan 8, 2023
OGRE is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware.

OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware. The class library abstracts all the details of using the underlying system libraries like Direct3D and OpenGL and provides an interface based on world objects and other intuitive classes.

null 3.1k Jan 3, 2023