Spreading the Load with
Parallel Processing —
Working as a Team
The MIDI controller PCB also has true parallel
processing to improve throughput. Figure 12 gives an
example of what each processor is doing at a snapshot in
time; the MIDI controller is midway through processing a
received note. At the same time, the foot-switch controller
is listening for a foot-switch press; the metronome
controller is listening for a ‘beat’ command; and finally, the
UI controller is busy updating the display.
Parallel processing needs efficient inter-processor
communication. This system uses three protocols (shown
in Figure 13), each one carefully designed for their unique
The foot-switch controller sends commands to the
MIDI controller via a burst of pulses, with the pulse width
representing the command. This is a single-pin solution
without any handshaking. The presence of a pulse is
polled by the MIDI controller. A batch of pulses is sent in
sufficient number to ensure the MIDI controller always
receives the command.
After reception, the MIDI controller doesn’t listen
again for a while. This system works well for foot-switch
presses because they are relatively infrequent.
The MIDI controller sends beat messages to the
metronome controller. Because of pin shortages on the
PIC16F648A, we cheekily piggy-back an LED pin. Because
the ‘play’ LED is synchronized with the beat, we send
a very short three-time-slot burst of signal at every beat
transition. This signal is invisible to the eye.
Lastly, the MIDI UI controllers communicate using
standard SPI (bit-banged) that has an additional initial
handshake. Before comms start, the sending device flags
that it wants to send, then waits for a handshake. The MIDI
controller is always the SPI master.
SRAM and Dynamic
Memory Allocation — The
A movie theater can’t just allocate seats sequentially.
If people cancel their bookings, the ‘holes’ must be filled
if possible. The same goes for our SRAM data. We need
what’s called Dynamic Memory Allocation (DMA).
Figure 14 gives an overview of how SRAM is used.
If all we ever wanted to do is add data, then all would
be easy. However, the reality is that we can delete songs
; MIDI Replay schematic.
September/October 2018 33