V1.0ProtocolDetails

From Firmata

Jump to: navigation, search

Contents

Firmata v1.0 Protocol Details

This version of the protocol is now obsolete, check ProtocolChangeLog for what changed, and Protocol for the most up-to-date version.

Message Types

/* MAPPING DATA TO MIDI

  • This protocol uses the MIDI message format, but does not use the whole
  • protocol. Most of the command mappings here will not be directly usable in
  • terms of MIDI controllers and synths. It should co-exist with MIDI without
  • trouble and can be parsed by standard MIDI interpreters. Just some of the
  • message data is used differently.
  • MIDI format: http://www.harmony-central.com/MIDI/Doc/table1.html
  • MIDI
  • type command channel first byte second byte
  • -----------------------------------------------------------------------------
  • analog I/O 0xE0 pin # LSB(bits 0-6) MSB(bits 7-13)
  • digital I/O 0x90 port base LSB(bits 0-6) MSB(bits 7-13)
  • report analog pin 0xC0 pin # disable/enable(0/1) - n/a -
  • report digital ports 0xD0 port base disable/enable(0/1) - n/a -
  • digital pin mode(I/O) 0xF4 - n/a - pin # (0-63) pin state(0=in)
  • firmware version 0xF9 - n/a - minor version major version
  • system reset 0xFF - n/a - - n/a - - n/a -
  • /

Data Message Expansion

/* two byte digital data format

  • ----------------------------
  • 0 digital data, 0x90-0x9F, (MIDI NoteOn, but different data usage)
  • 1 digital pins 0-6 bitmask
  • 2 digital pins 7-13 bitmask
  • /

/* analog 14-bit data format

  • -------------------------
  • 0 analog pin, 0xE0-0xEF, (MIDI Pitch Wheel)
  • 1 analog least significant 7 bits
  • 2 analog most significant 7 bits
  • /

/* version report format

  • Send a single byte 0xF9, Arduino will reply with:
  • -------------------------------------------------
  • 0 version report header (0xF9) (MIDI Undefined)
  • 1 minor version (0-127)
  • 2 major version (0-127)
  • /

Control Messages Expansion

/* set digital pin mode

  • --------------------
  • 1 set digital pin mode (0xF4) (MIDI Undefined)
  • 2 pin number (0-127)
  • 3 state (INPUT/OUTPUT/PWM/SERVO, 0/1/2/3)
  • /

/* toggle analogIn reporting by pin

  • --------------------------------
  • 0 toggle digitalIn reporting (0xC0-0xCF) (MIDI Program Change)
  • 1 disable(0)/enable(non-zero)
  • /

/* toggle digitalIn reporting by port pairs

  • ----------------------------------------
  • 0 toggle digitalIn reporting (0xD0-0xDF) (MIDI Aftertouch)
  • 1 disable(0)/enable(non-zero)
  • /

/* request version report

  • ----------------------
  • 0 request version report (0xF9) (MIDI Undefined)
  • /
Personal tools