The MIDIbox Operating System

The MIDIbox Operating System (MIOS) has been developed for the requirements of flexible MIDI applications like MIDI controllers, processors, synthesizers, sequencers. In difference to commercial ready made and closed source solutions, MIOS follows the concept of an open computing system as fundament for idea exchange and personal adaptations.

The MIDIbox Gallery already points out different opinions in terms of panel design, control elements and preferred workflow. Most of these MIDI controllers are based on MIDIbox64, MIDIbox16E or MIDIO128 and therefore limited to the provided features of the firmware. With MIOS, such controllers can be enhanced to multipurpose devices with exchangeable program code, totally customized to the appr. host application, synthesizer or similar "MIDI devices". By releasing the application source codes, everybody will be free to use them as template for modifications and improvements. In this manner MIOS breaks down the skill barrier to getting started with microcontrollers and allows - even people new to electronics - to realize projects far away from the main stream.

Between 1999 and 2008, MIDIbox applications have been developed for PIC microcontrollers, since 2002 with MIOS8 as operating system. Most of them are implemented in assembly language to get the maximum out of the PIC, with the drawback that the code was difficult to understand and to enhance - not only for newbies. Later a C interface has been developed to allow the implementation of small gadgets on a more elegant way, but experienced programmers quickly reached the limitations of the PIC where only assembly optimized code or the usage of multiple PICs could help.

Between 2008/2010, MIOS32 has been developed for the STM32 microcontroller. No stone has been left unturned! As you can see in some tutorial applications, execution performance doesn't need to be focused anymore, the usage of assembly language isn't required to realize even complex projects like an algorithmic MIDI sequencer or an audio synthesizer. Interfaces like USB (e.g. for native USB MIDI support) and Ethernet (e.g. for native OSC support) speed up the communication with external devices dramatically, the usage of a SD Card instead of BankStick simplifies data exchange, premade software modules (libraries) reduce the time to develop new applications..

Since 2011, MIOS32 supports LPC17xx microcontrollers. Most applications which access peripheral functions via the MIOS32 Hardware Abstraction Layer are 100% compatible and only need to be recompiled for this microcontroller. Applications are typically running ca. 30..50% faster on a LPC1769, and thanks to the usage of the LPCXPRESSO evaluation board as basis it's also easier to adapt the "base board" for different usecases..

Since 2013, MIOS32 also supports STM32F4 microcontrollers. Again most applications which access peripheral functions via the MIOS32 Hardware Abstraction Layer are 100% compatible and only need to be recompiled for this microcontroller. Applications are typically running ca. 2..3 times faster compared to STM32F1, and ca. 50% faster compared to LPC1769..


Core Module: MBHP_CORE module MBHP_CORE_STM32 module MBHP_CORE_STM32F4 module MBHP_CORE_LPC17 module
Microcontroller: PIC18F452
STM32F103RE STM32F407VE LPC1769
CPU: PIC18 MCU (8-bit) ARM Cortex M3 (32-bit) ARM Cortex M4 (32-bit) ARM Cortex M3 (32-bit)
Speed: 10 MIPS @ 40 MHz 90 DMIPS @ 72 MHz 210 DMIPS @ 72 MHz typically 30..50% faster @120 MHz than STM32F1 @72 MHz, but slower than STM32F4
Embedded memory: 32k..96k Flash
1.5k..3.9k RAM
512k Flash
64k RAM
1024k Flash
196k RAM
512k Flash
64k RAM
IO voltage: 5V 3.3V, but most input pins are 5V tolerant 3.0V, but most input pins are 5V tolerant 3.3V, but most input pins are 5V tolerant
Price of uC only: ca. US $5..$10 ca. US $10 ca. US $12 ca. US $12
Core module kit with all parts: US $27 (Double Sided PCB, SmashTV)
EUR 23 (Single Sided PCB, Mike)
US $57 (SmashTV)
STM32 chip already soldered on PCB
ca. 20..30 EUR with all components (TODO: check once final PCB is available) ca. 50 EUR with all components, but low-cost solutions will be available as well (more DIY friendly)
Software Architecture
Kernel: Monolithic kernel programmed in assembly language. Two priorities (interrupt and main task), hooks to hard- and software events which optionally execute C routines. Modular kernel programmed in C language, combined with (but not strictly tied to) FreeRTOS as realtime operating system.
While FreeRTOS provides preemptive multitasking, multiple tasks priorities and synchronisation mechanisms, MIOS32 acts as an abstraction layer between hardware and software components.
Bootloader: yes, via MIDI (requires reliable MIDI interface) yes, via MIDI and USB MIDI (no additional MIDI interface required)
Applications: PIC Assembly or C based.
Compiled as a separate binary.
C (optionally C++) based.
Compiled together with FreeRTOS, MIOS32 and software modules to a single binary.
Toolchain: GPASM and SDCC based GCC based
SVN Repository: LINK LINK
Documentation: LINK and LINK LINK and LINK
Download Area: LINK LINK
Open Source: yes (completely) yes (completely)
License: Personal non-commercial use only Personal non-commercial use only
Natively supported Peripherals
MIDI Interface: 1 MIDI IN, 1 MIDI OUT 2 MIDI IN, 2 MIDI OUT, optional third MIDI IO available at J5 4 MIDI IN, 4 MIDI OUT available at J10E 2 MIDI IN, 2 MIDI OUT, optional third MIDI IO available at J5, optional fourth MIDI IO at J4B
USB Device Interface: no yes
USB Host Interface: no yes no
Ethernet Interface: no only via external HW only via external HW yes, integrated
CAN Interface: only PIC18F4685 yes, but can't use USB in parallel! yes yes
JTAG Interface: no yes (for code debugging, e.g. to set set breakpoints, display runtime variables, etc.)
LCD Interface: yes (J15, multiple LCDs can be connected by sacrificing IO pins) yes (J15A/B to connect two LCDs, more LCDs can be connected by sacrificing IO pins)
Direct digital IO: 8 free programmable IO pins (Port J5) 12 free programmable IO pins (Port J5A/B/C) 24 free programmable IO pins (Port J5A/B and J10A/B) 16 free programmable IO pins (Port J5A/B and J10)
Serial digital IO: Up to 128 inputs via DIN module, up to 128 outputs via DOUT module.
IO pins can be multiplexed to extend the number of controlable buttons/LEDs.
Only limited by execution time and used HW buffers
Direct analog IO: 8 analog inputs (Port J5) at 10 bit resolution and 5V range 16 analog inputs (Port J5A/B/C, J16) at 12 bit resolution and 3.3V range 8 analog inputs (Port J5A/B) at 12 bit resolution and 3.0V range 8 analog inputs (Port J5A/B) at 12 bit resolution and 3.3V range
Multiplexed analog IO: up to 64 analog inputs, multiplexed via MBHP_AIN module(s) via one or multiple MBHP_AIN64SER module(s)
Serial/Parallel Interface (SPI): Software emulated, e.g. to scan DIN/DOUT modules. 2 hardware based interfaces (J8/9 and J16), 1 software emulated (J19) 3 hardware based interfaces (J8/9, J16 and J19) 2 hardware based interfaces (J8/9 and J16), 1 software emulated (J19)
I2C Interface: 1 SW based 1 HW based, another alternative 2 HW based 3 HW based
I2S Interface: no yes (but shared with J8/9) On-Board Audio DAC yes, dedicated port!
Software Layers
MIDI: yes (single port, stream oriented access) yes (multiple ports and interfaces, packet oriented access)
COM/RS232: no yes (multiple ports and interfaces)
Ethernet: no yes (via ENC28J60) yes (via ENC28J60) yes (integrated)
OSC: no yes (via Ethernet or alternative transport device)
BOARD: as library component part of MIOS32
TIMER: 1 at uS accuracy 3 at uS accuracy, more at mS accuracy can be defined as FreeRTOS tasks.
Realtime Clock no yes, at mS resoltion yes, at mS resoltion yes, but only S resolution
SRIO: 128 DIN, 128 DOUT pins (2 * 16 shift registers) 128 DIN, 128 DOUT pins (2 * 16 shift registers)
Number of SRs extendible with hardware enhancements, e.g. usage of buffers for SCLK/RCLK line.
ENC (Encoders): up to 64 detented or non-detented rotary encoders like MIOS8, but number free definable
MF (Motorfaders): up to 8 use the MBHP_MF_NG module
IIC: yes (single port) yes (two ports) yes (two ports) yes (three ports)
IIC_MIDI: as library component part of MIOS32 MIDI API
BANKSTICK: yes (up to 8 32k and 64k)
SD Card: as library component, but limited FAT support yes. FATFS module supports FAT12/FAT16/FAT32
(Internal) EEPROM: accessing 256..1024 byte depending on PIC accessing up to 2047 byte via EEPROM emulation accessing up to 2047 byte via EEPROM emulation onboard 1k IIC EEPROM
LCD: Various CLCDs and GLCDs as library component/software modules
I2S Audio: no yes (16bit Stereo)

MIOS Applications

Now some words to the most interesting part: which applications can be realized with MIOS8. In respect to the limitations of the sweet little PIC it should be clear that it isn't possible to implement a workstation with a splendidly constructed graphical user interface, support for audio samples, video processing, voice recognition or similar memory eating programs. The strengths of a PIC microcontroller are microsecond accurate IO interactions and realtime processing. Here a few examples, some of them have already been implemented (see the MIOS Download page:

  • generic MIDI control device with pots/faders/buttons/motorfaders/encoders/leds/led-rings
  • MIDI IO processing device
  • emulation of existing controllers (for instance Logic Control or Steinberg Houston)
  • sequencers
  • synthesizers
  • ...add your wishes here...

Of course, MIOS allows also to manage other jobs outside the world of MIDI, here some inspirations:

  • Robotics
  • Light control
  • HiFi equipment control
  • Game computer
  • Kid's computer
  • Handheld
  • ...add your wishes here...

Enhanced list for MIOS32 based designs:

  • as above, but easier implementation for resource hungry and complex applications
  • MIDI IO processing device with generic support for USB (more than 100 times faster)
  • access to Ethernet, usage of OSC protocol for direct communication between devices (no PC based proxy required)
  • I2S based audio synthesizer/sampler
  • handling touch panels and graphical LCDs w/o memory limitations
  • ...add your wishes here...

Questions & Answers Addendum

This Addendum is now part of the MIDIbox Wiki (it doesn't consider MIOS32 yet)

Wikipedia Entry


Last update: 2016-05-22

Copyright 1998-2016, Thorsten Klose. All rights reserved.