Control Surface Firmware



Algorithms for motor control, analog conversion, and MIDI messaging, and LCD display.





Application Information

The firmware is composed in assembly language.   The source code is formatted to assemble using the popular Metalink 8051 assembler.  A fully assembled "prom" image will be available for downloading from the site in "hex" representational format.

Typical of embedded software, the MIDI Control Surface is heavily interrupt driven.   Hardware counters,two incoming serial (MIDI) ports, a watchdog timer(integrated into the microcontroller)are the source of these interrupt.

MIDI Message Handling

Two common approaches to low level MIDI message framing typically implement.
  • One approach directly frames individual message bytes as they are recieved.
  • The alternate approach implements a receive buffer which "front ends" message framing logic.
The first approach works but requires critical timing and variable management. The second approach separates receive data handling and message framing.

This Control Surface implements 32 byte serial recieve buffer which queue's incoming data allowing message handling to with less direct coupling to incoming data rate.

Low Level I/O Routines

Each major Input/Output device is provided a Service Routine which presents a simple messaging interface to the rest of the software system while "hiding" the specific signalling that must occur to excersize a specific I/O resource.

The Input/Output Routines and the devices they service tabulate below:

 I/O Routines
RoutineResourceDefinitionType
 SIO1 IN SIO-1 RXD Buffer 1 incoming receive byte  Interrupt 
 SIO1 IN SIO-0 RXD Buffer 1 incoming receive byte  Interrupt 
 MIDI IN "A" SIO-1 IN Receive 1 complete MIDI Message  Procedural 
 SIO-1 tx  SIO-1 TXD Issue 1 byte out of the serial port  Procedural 
 SIO-0 tx  SIO-0 TXD  Issue 1 byte out of the serial port  Procedural 
 MIDI IN "B"  SIO-0 IN  Receive 1 complete MIDI Message  Procedural 
 MIDI OUT "A"  SIO-1 tx  Issue 1 complete MIDI Message  Procedural 
 MIDI OUT "B" SIO-0 tx Issue 1 complete MIDI Message  Procedural 
 LCD OUT P2,P3.4,P3.5, P1.4  Issue 1 byte to LCD Display  Procedural 
 I2C OUT  MAX7300 Issue a byte to selected Port Expander  Procedural 
 ENABLE MOTOR   I2C OUT   Issue a byte to selected Port Expander  Procedural 
 SET MOTOR DIRECTION   I2C OUT Set State of 2 specified Motor Direction Bits   Procedural 


Hosted by www.Geocities.ws

1