Skip to content
makapuf edited this page Jun 10, 2016 · 5 revisions

The Bitbox Micro

Bitbox micro logo

TL;DR

Upload games
Develop games FAQ

Foreword

The bitbox micro is an evolution of the Bitbox. As getting a more powerful bitbox would be too powerful, I've decided to make an half-bitbox : keeping all the fundamentals from the bitbox, but halving every spec.

The fundamentals we're talking about are : VGA Out, stm32 ARM Cortex-M, USB Power, USB peripherals, all plugs on bitbox.

Why ? Because, half-spec means 2x the challenge to code a game (while simple game being quite simple), while making art somewhat easier.

The idea is not to replace the bitbox, which is still the nice small console we like, but a little sister, just a little more challenging :)

Specs

As you see, everything was halved. I originally wanted to go much smaller than that, but to drive a VGA and still keep a lot of CPU a DMA was nice to have, and smaller st chips don't have a powerful enough DMA for churning out the pixels fast enough for VGA. Keeping an F4 was better for compatibility, and the smaller is the stm32f401. Keeping 512k implied we could make nice graphics however and big games.

Bitbox Bitbox Micro
Speed 168MHz 84 MHz
Flash mem 1024kB 512kB
RAM 192k 96kB
Max resolution 800x600 400x300
Bit Depth 15 bits 8bits
Sound Stereo Mono
USB host ports 2 1
Expansion port 10 pins 4pins (PWR, UART)
SWD/on-chip debug Yes Yes
microSD slot 1 0
PCB (in) 2x2.5 1x2
Components ~60 ~30
Price/Cost to build Half !

The MCU used is a STM32f401CEU6 : it has a Cortex-M4F which is entirely compatible with the f405 from the bitbox.

Available colors

The 256 colors that a Micro can show can be represented by a RRRGGBBL byte pixel. This outputs three 3bits RRR, GGL and BBL channels where the L bit is shared between G and B, allowing 8 levels of grey.

An analysis of the palette is given here or here.

Using the Micro

Plugging the Bitbox Micro

The bitbox micro has the following plugs :

  • A VGA plug. Just plug a VGA device here
  • A 3.5mm or 1/8" Jack : used as a mono sound output for your device (TV, Amp ...)
  • A USB A plug : plug a keyboard, a mouse or your gamepad here.
  • A microUSB : power your bitbox using this or connect it to a PC in BootMode (see uploading). Note that connecting it to a PC might not work for just powering up (try it!). You'll sometimes need a proper USB (dumb) power adapter.
  • A side connector (or a place to solder one) : This connector is marked on the PCB and has the following pins :
side 1 2 3 4
Top SWD Clk SWD IO GND Boot 0
Bottom UART Tx UART Rx GND Vcc 3.3v

You can see that Vcc 3.3v can be used either for connection to Boot0 - more about that just after - or for powering the bitbox micro. Be careful : DON'T put more than 3.7V there ( NO 5V ! ) since it's UNREGULATED. This allow the double function for Boot0 and powering in. (You can run on batteries). However, also note that in that case USB devices will not be properly powered by bitbox and so will most often not work when bitbox is powered this way.

Uploading binaries to the micro

As the micro doesn't have an SD card, you'll have two choices :

  • If you plug the header between Boot0 and the pin below, the micro will be put to bootloader mode, so plug your micro to a PC, and you'll see that it can be reflashed using a DFU Utility.

Those exist for Windows or Linux. For linux (your distro might have this package), there is dfu-util for win32, the official DFuse utility from ST Micro can be used.

  • Alternatively, you can flash your micro, and debug it, using the standard SWD 3 pin connector, while providing power to your bitbox micro using either usb power or 3.3v with gnd/pwr pins)

Developing for the bitbox micro

Development for the micro should be the same than for the Bitbox. You can compile the same game for the micro and bitbox (provided you stay within the micro specs, of course). The engines will be ported in time. The only differences are :

  • no button, gamepad_buttons[1] will always be 0
  • graphical interface is through 8-bit data : For that, just define a graph_line8(void) instead of graph_line() callback (use vga_line, vga_odd and vga_frame as usual). 📝 Notice that draw_buffer is u16[] for compatibility reasons. Just cast it to u8* to blit pixel by pixel.(you should really cast it to u32* for speed).
  • sound is mono, so kernel interface is u8*
  • not all modes are defined !

In fact, you can then build you project the same, just change the makefile target.

New targets include :

  • make $(NAME)_micro.bin (for just the micro)
  • make stlink-micro (to upload to the target)
  • make dfu-micro (to upload with dfu-util) to the micro
  • make debug-micro (to use remote gdb + st-util)

note that a simple make will only make the emulator and the bitbox binary

FAQ

...