Technically Speaking (Part 2)
Part two in our build-your-own-MIDI link for a BBC and DX21.
The column that builds, literally. Andy Honeybone, a computer literate, continues his construction of a MIDI link for the Yamaha DX21 and BBC micro. Sequencing is only a step away...
Last Month we began the design of a MIDI interface for a BBC micro. In this instalment the hardware description is continued and brief programs for testing are presented.
The hard work of parallel-serial interconversion is performed by the 6850 ACIA chip. The receive and transmit clocks are provided from the flip-flop and the chip select lines CS0 and CS1 are connected to the output of the NOR gate which combines the low and high order address decodes. The modem lines NDCD and NCTS are taken to ground along with the NCS2 chip select. Output enable is driven by the 1MHz clock and the Read/Write line is taken to the bus connection of the same name. This leaves the 8 data lines which are taken straight to the bus along with address line zero and, finally, the NOT Interrupt Request which may be used to generate NMMIS or NIRQs as desired.
It is the optocoupler input that differentiates this circuit from a bog-standard RS232 interface running at a funny baud rate. MIDI-in provides the current to drive the LED of the isolator and the only other circuitry required on the synth end of things is a current limiting resistor and an inverse polarity protection diode. The phototransistor side of the coupler needs just one resistor which you might like to know took me three-quarters of an hour poring over abandoned circuit boards to find. It happens to the best of us.
MIDI-out is even simpler - just a pair of inverters to provide current drive, and a resistor. Note that pin 2 of the out DIN socket is earthed to provide shielding for the twisted pair MIDI cable (1.5 metre HiFi cables worked OK for me). Do not earth the MIDI-in socket or you will have undone all the good of opto-isolated hum loop prevention.
Those of you who will not rest until every element of every IC package is used up will no doubt be wondering what to do with the three spare 74LS04 inverters. Two can be used to provide a MIDI-thru facility by duplicating the MIDI-out buffer and connecting it to the receive input of the 6850. The last spare inverter can be used to provide another MIDI-out by connecting it to the output of the first inverter after the 6850 transmit pin.
Before you all write in to tell me that I have transgressed the Acorn One Megahertz Bus Commandment by putting more than 1 LS-TTL load on each line, let me say a few words in my defence. It works! It has been noted elsewhere that even Acorn do not follow their own teachings. Seriously though folks, building an interface is potentially putting at risk both pieces of the kit you're trying to join up. Brown corduroys are recommended for the first time you power up the BBC and interface and the screen won't come up with a sign-on message. I wouldn't like to have built the thing without having my trusty oscilloscope handy to check each stage of the construction but then I was designing it as I went. You should be able to manage with just a multi-meter for checking shorts.
Feature by Andy Honeybone