The Physical Design
The end result after much thought and practical
consideration is the physical design depicted in Figure 9.
The design has three printed circuit boards (PCBs): a
MIDI replay PCB; a user interface PCB; and an
LCD display PCB. As in any electronics project,
the choice of each microcontroller is a balance
of many factors including: the tasks to perform;
the component cost; ease of use; features;
physical size; code capacity; and memory
The user interface PCB responds to button
pushes and drives the LCD display. As a PCB, it’s
relatively simple. It also holds the overall voltage
regulator for the system.
The LCD display PCB contains a standard
20x4 character display and uses the ubiquitous
Hitachi HD44780 LCD controller. The interface
to the PCB is parallel to improve performance.
The MIDI replay PCB is worthy of greater
The MIDI Replay PCB
— the Core Module
This is the core of the system and is a module by
design, so it can be used in other systems. A photo of the
PCB is shown in Figure 10.
The PIC16F648A processes everything MIDI
related. An associated 20 MHz crystal drives its
clock at full throttle. A 23LCV512 high speed
battery-backed SRAM device is used to store note
data and song configuration data. Two smaller
PIC12F683s process the foot-switch messages
and the metronome beats. A 6N138 opto-coupler
shapes the incoming MIDI signal into a digital
Finally, an audio circuit filters and outputs the
metronome Pulse-Width Modulated (PWM) ‘beats’
via a piezo speaker and headphone socket.
Apart from MIDI, all communication with the
board is via commands that control recording,
playback, and other functions. There are 26
commands in total. The communication protocol
is straightforward and can be bit-banged from any
The full circuit diagram is provided with the
article downloads. You’ll notice that there are three
MIDI outputs (each with double-inverter buffers).
Having three is useful if you want to output to
multiple physical MIDI devices.
If you don’t need foot-switch control and a
metronome, then the minimum circuit is simply
; FIGURE 11. The MIDI controller chip — very busy
; FIGURE 10. The MIDI replay PCB.
30 September/October 2018