Circuit Python 2023: The year of the CircuitPython Retro Gaming Personal Computer
Let's hope the "CircuitPython Retro Gaming Personal Computer" (RGPC) idea will not follow the "Linux Desktop" trend... I said it in 2021 (https://learn.adafruit.com/u/dglaude/circuitpython2021-the-year-of-the-circuitpython-retro-gaming-personal-computer) but this require a revisit because many of the things I wanted for 2021 are not there yet, so 2023 will be the year...
We are getting closer and closer to that goal, but this time the RGPC will be multi-processor using as many RP2040 as possible to offload some task from the main CPU (that could be a PicoW or something else RP2040).
Because there are new twists (and tricks) possible with that incredible microprocessor.
- Twist 1: PT and LadyAda describe it almost in this sequence on 2023-01-04: https://www.youtube.com/watch?v=LiYf2Ail7ZM&t=960
- Twist 2: Jepler showed an Pico acting as a DVI output co-processor https://www.youtube.com/watch?v=Q14WCY_z7zo&t=524s
- Twist 3: John Park demonstrate having a SNES joystick talking to CircuitPython (the Pico NES emulator also use USB OTG to read from a "Sony Dual Shock 4" or a "Sony Dual Sense")
So all those demo are connected and show the possible peripheral or coprocessor that could be done with RP2040 and be part of the "Retro Gaming Personal Computer". Let's try to put some of those YouTube chat into writing to have kind of a plan.
The most inspiring "Retro Gaming Personal Computer" experience to me was the $9 C.H.I.P computer from Next Thing Co (NTC) and in particular the Pocket CHIP with it's screen and keyboard. Well the C.H.I.P. also had a VGA adapter and an HDMI adapter you could plug. and the resolution of the Pocket CHIP LCD is 480x272.
While my reference for "Retro Gaming and Programming" experience was Pico8 with 128x128 resolution... my new target is Picotron with it's 480x270 resolution... not in LUA, but using Python!
Let's see the various component and how we can handle those.
Screen:
- The magic Pico DVI co-processor: you dedicate a pico to do the DVI signal (this is Twist 2 from Jepler). We just need to not use Pimoroni Pico DV but have LadyAda design a more simple board designed as an add-on for the primary computer. Maybe for the connection Adafruit could use EYESPI connection to integrate that in the ecosystem.
- The same trick with VGA... If Jepler and PaintYourDragon can do that DVI co-processor board, they surely can do it in VGA too, I think for the Retro feeling VGA is key so it would be great to do that in a second time.
- Of course, displaying on a normal LCD screen with DisplayIO on the core computer is also OK... to make it modular, EYESPI again.
Notice that waiting for an Adafruit DVI co-processor, the one from Pimoroni has audio output and SD card function. Maybe the SD card feature can be maintained as that would work over EYESPI and is sometime present on LCD screen too, but the audio should be separate and from another optional board)
Sound:
- To give it a retro style, I guess some MIDI output is a good idea... talking MIDI is OK for the main processor, but we need some kind of RP2040 based midi synth. Can this be done???
- Many arcade machine of the past were using a Z80 or other processor as sound processor, I guess this could be done with a RP2040 too.
- Worth case scenario, I guess a buzzer "BEEP" level sound can be done with PWM and does not need to be externalized?
Keyboard:
We still are missing a way to talk "keyboard" to CircuitPython REPL, not using the serial over USB. But let's from a hardware point of view what can be done.
- I believe Solder Party "BB Q20 Keyboard" is great solution as it exist, contain an RP2040 and talk I2C. This could be a great input for the "Computer".
- We have Jepler frequently showing and making learn guide on how to use old keyboard and make them USB... maybe he can do them I2C and talk a "BB Q20" I2C protocol too?
- Or course it is possible to build your own keyboard with an RP2040 as the scanning brain, think KB2040, but maybe that is overkill, anyway doing it I2C avoid the USB-HOST need.
- If we have USB-HOST, the we could have a USB keyboard be the keyboard of that "computer". Maybe USB Keyboard is not retro enough... and should be avoided?
Joystick:
- The cheap solution for joystic is to use "Nunckuk" I2C protocol and use Joystick for the Wii. Adafruit has the adaptor for those
- As seen before, CircuitPython can read from NES and SNES shift register joystick... maybe that is the solution?
- If really needed, Adafruit can handle button and analogue stick, this could be a board, with an RP2040 and be a co-processor for input...
Storage:
- There is flash, so flash can be the storage... however it is frequently ready only so not very funny.
- SD card or micro SD card are well supported, maybe the "Computer" need to use that.
- On the more retro side of things, tapes and sound was storage of the past, maybe this is still possible, but who want to do that?
- Adafruit made a lot of work on Floppies... obviously a Retro computer could read from Floppies. To make it super retro, it could be like the C64 floppy drive... an RP2040 would act as a co-processor and control the floppy drive.
It seems that what PT and LadyAda described as building all the piece from a computer, using RP2040 is really possible.
One need to define the communication standard from the main computer to those peripheral, My take would be:
- EYESPI for the screen
- I2C for keyboard, mouse and joystic
- MIDI for the sound
- SDcard for the storage
Sometimes it seems overkill, but let's take the most RP2040 possible solution:
- Pico DVI co-processor attached with EYESPI
- I2C keyboard "BB Q20" with the build in RP2040
- Floppy disk controller that present itself like an SD card reader, so having an RP2040 to control the disk drive.
- To be invented RP2040 based MIDI Synth for the sound (not the MT32-Pi on a Raspberry Pi SBC, we want an RP2040 solution)
![Retro_Gaming_Personal_Computer.png](https://cdn-learn.adafruit.com/user_assets/assets/000/000/091/large1024/Retro_Gaming_Personal_Computer.png?1673958548)
Additional possible feature:
- Jepler think that it could be possible to include camera support, however it depend a lot on PIO available. That feature is not really important as it did not exist in the computer from that era, except maybe the Game Boy Camera. Here is a guide on CircuitPython camera support: https://learn.adafruit.com/circuitpython-webcam-with-ov2640
- Printing could be a nice addition as that feature existed, including for the ZX81 or ZX Spectrum. Thermal printer is actually the technology used at the time and luckily supported in CircuitPython with this BLE printer: https://learn.adafruit.com/ble-thermal-cat-printer-with-circuitpython . There is however the issue that BLE is not available (yet) on the Pico or RP2040, so some sort of co-processor will be needed if we want to talk to a printer.
- Networking? That was not a thing for retro computer... but nowadays, some kind of connection is always needed. If we want cheap wifi, then a PicoW could be the earth of the computer... else we need to use AirLift, but that require an SPI buss that could be already needed for the screen or the SD Card.
The way to get there..
Keyboard input
We need keyboard input into the core... a bit like we can input from the serial (from a host), from the wifi workflow and maybe from the BLE workflow. We need a keyboard input that does not require a host, so that our "Circuit Python Retro Gaming Computer" can be used standalone, with no other parts.
We have support for various kind of keyboard:
- PS2 keyboard are supported, but harder to find.
- matrix keyboard scanning the row and column
- we can read from Bluetooth keyboard (I think)
- In Python land we can read from I2C keyboard (like BB Q20 or a "Adafruit TCA8418 Keypad Matrix and GPIO Expander", or maybe a "Grove CardKB Mini Keyboard Programmable Unit V1.1")
- Maybe one day we will support any USB keyboard with USB Host, but this is not there yet.
But what we need is a standard way to turn key press into input for the REPL or so. I believe I2C is the way to go. And we coud have an RP2040 acting as a keyboard co-processor that take one of the current possibility or future possibility and turn that into the protocol of choice. Potentially the keyboard could run CircuitPython, the same way it is possible to run CP on the BB Q20.
Unified video output interface
The big fun is to display on a screen, VGA (for more retro feeling) or HDMI. But of course we should not forget simple LCD screen (great for portable solution) that are already supported by DisplayIO. Obviously EYESPI is the way to go, and we are just missing the EYESPI to DV (HDMI) and maybe EYESPI to VGA.
Some software trick on the main Central Processing Unit
There is some missing software glue to make such a system usable. That software must run on the main brain board (likely some kind of Feather RP2040 with EYESPI connector) and it should permit to configure the system, edit file, execute file (via REPL). Those are function you can find in the Web Workflow, but it need to be done local.
What about my USB-HOST dream of 2021?
I still believe it would be super helpful for the Assistive Technology community to have USB-HOST in CircuitPython, even if this is limited to the RP2040 board for a start.
But USB-HOST support is not required for the CP-RGPC, we can use I2C for keyboard/mouse/joystick.
Of course I would love to be able to use any USB keyboard and natively use that with CircuitPython, as input for the REPL, or even just to be able to convert it to something else. I would also like to convert some legacy USB joystick or else to other more modern protocol. But this is a side project.
Tentative BoM
Please remember that this is totally hypothetical, it's only potentially useful product that may or not make it part of a working solution.
Product potentially useful but not available from Adafruit:
- Pimoroni Pico DV
- Solder Party BB Q20 Keyboard
Adafruit product potentially useful for this project:
![Hand holding a Wiichuck controller pressing buttons. The controller is connected to the breakout wired to a Feather with OLED showing the streaming controller data](https://cdn-shop.adafruit.com/product-videos/640x480/4836-06.jpg)
![Video of DVI breakout board on breadboard with Raspberry Pico RP2040 hooked up with jumper wires. A small HDMI monitor displays a psychedelic animation with Raspberry Pi logos and bouncing middle-aged white man bust of Raspberry Pi founder.](https://cdn-shop.adafruit.com/product-videos/640x480/4984-04.jpg)
![Angled shot of black rectangular microcontroller "Feather RP2040"](https://cdn-shop.adafruit.com/640x480/4884-07.jpg)
![Angled shot of blue, square-shaped, amplifier breakout with a pre-soldered terminal block.](https://cdn-shop.adafruit.com/640x480/3006-04.jpg)
![Half-size breadboard with a soldered skinny green microcontroller.](https://cdn-shop.adafruit.com/640x480/5422-03.jpg)
![Video of hand holding a QT Py PCB in their hand. An LED glows rainbow colors.](https://cdn-shop.adafruit.com/product-videos/640x480/4900-06.jpg)