Mini Cyberdeck 0o00

An introduction to the BalCCon Mini Cyberdeck MC-0o00.

Mini Cyberdeck 0o00
Listen up you primitive screwhead. You have the tools. You have the power. Now use it; fairly, wisely, and nastily. After all, you're the one who wanted to be Cyberpunk. (—cp2077)

Introduction

The all new Mini Cyberdeck 0o00 (MC-0o00) is the badge for the BalCCon 2k24 conference. At its heart is the CH32V003 processor. It features an ST7735 lcd display, a piezoelectric buzzer and 6 buttons. It also features an interface for 2.7V to 5.5V power and 4 general purpose input / output (gpio) connections and can be connected to the BalCCon Cyberdeck 0o27 (BCD-0o27).

A Closer Look at the Hardware

MC-0o00 schema

The main Processor

The main processor of the MC-0o00 is a WCH CH32V003F6P6. This is a RISC-V processor with a QuingKe 32bit core that supports the RV32EC instruction set. It has 16kb of code flash and 2kb of SRAM for volatile data storage.

The Display

The display is our old and proven ST7735, the same as in the BCD-0o27. It is driven through SPI. The display driver is available at the CH32V003 ST7735 Driver Gitlab page.

The Buttons

The buttons are simple push buttons. To save on generial input / output (GPIO) connections to the chip the three on the left share one GPIO and the three on the right share one GPIO. The GPIO needs to be configured as an analogue to digital converter (ADC). The driver which also documents the ADC values in the header file can be found at the CH32V003 Joypad Gitlab page.

The External Interface

The external interface exposes four pins from the CH32V003. The pins are pin 11 (PC1 / SDA), pin 12 (PC2), pin 18 (PD1) and pin 8 (PD0).

Firmware

At the time of writing, there exist three firmwares. There will likely be more, especially if you get creative and publish yours.

If you got your badge at BalCCon, it either will be flashed with a test firmware that allows testing the hardware or with the conference firmware. If you built your own cyberdeck it does not have any firmware. Refer to the next section to find which one you want to download.

You can either set up the development framework as described below and clone the repositories (where present). This will give you the advantage of seeing the code and also adapting it as you like.

If the code is not available and you only get a firmware file, or if you want to avaoid setting up the development environment and just want to flash the firmware, I recommend using wlink. Once you obtained the firmware file, flashing a firmware on your cyberdeck is as easy as shown below.

wlink flash firmware.bin

For further information check the documentation of wlink.

Hardware Test

The hardware test firmware allows you to test if your MC-0o00 is fully functional. It is attached as a binary to this article. The test goes through three stages, testing the display, the buttons and the buzzer. Unfortunately, this simple cyberdeck cannot diagnose itself, but needs some help from you.

At the first stage you will be asked if you see the text on the display. If you do, press a button on the left of you MC-0o00 and if you don’t press a button on the right (and basically start fixing this display, no point to continue).

The second stage allows you to push the buttons. In the display for the left and the right side controls can be tested individually. To mark the test as passed, press the topmost button on the left side at the same time as the bottom most button on the right side. To mark it failed press the topmost button on the left side and the topmost button at the right side.

The third stage will play a melody on the buzzer. Press any button on the left side to mark the test passed or a button on the right side to mark the test failed.

Melody Maker

Melody maker is a firmware developed by Miaou. Its source code can be found at the Melody Maker Gitlab page. The melody maker allows you to compose 48 notes melodies and play them. There is also a python script in the repository to make handling melodies better.

The firmware starts up playing a preloaded song. It starts in the BMP mode. This means that the bpm value in the top left corner is marked and the full song is playing in a loop. In this mode pushing the topmost button on the left controller allows you to increase the tempo of the song and pressing the middle button on the left controller decreases the tempo.

To move use the bottom left button to move to the left and the bottom right button to move to the right. If you are in bpm mode, pressing left will move to the first node, pressing right will move to a blank space after the last note. You can then continue moving through the notes. Moving left on the first note will select the bpm menu, as will moving right on the last note.

If on a note, you can use the left top button to step up the value of a not. Halftones are displayed in gold. If you press the middle left button note values are decreased. Decreasing below the lowest note will add a silence, denoted by two dashes. A long press will allow you to jump octaves. To change the duration of a note use the top right button to increase duration and the middle right button do decrease it. A bar below the node indicates the length.

To add a note, simply move on right from the last note. You can only delete the last note by making it a silence. So if you need to shorten you song its one note at a time.

CB Pong

A simple pong game that can be played either by two players or - if set up - against a BCD-0o27 cyberdeck. The code is found at the CB Pong Gitlab page.

Space Invaders

A space invaders game developed by Jovan. The code is found at the CH32V003 Space Invaders Github page. It is released under the MIT license.

Programming

To get the most out of you MC-0o00 you should develop your own firmware.

Programming the MC-0o00

The article CH32V003 Introduction gives you a gentle introduction on how to setup the development environment and program the CH32V003 chip which is at the heart of you cyberdeck. It’s not based on the MC 0o00 and thus you cannot simply copy the code, but it will give you an idea.

Once you setup the development environment, there is a much better framework to program your cyberdeck. The ch32v003fun framework. I highly recommend you use this. The setup you did from the CH32V003 Introduction article can be used with this framework. The documentation of the framework is at the gitlab page. You can also look at the code from the existing firmware for the cyberdeck as they use the framework.

Connecting to the BCD-0o27

The MC-0o00 is meant to be connected to its larger sister BCD-0o27. The two can interact over the external interface of the BCD-0o27. One is to interact using I2C. You can find an example of how the BCD-0o27 can play pong against you if you have the Pong firmware from above flashed on you MC-0o00. You find the code at the bcd_cb_pong repository.

Additional Documentation