TRS80 Analogue/Digital Interface
This month we leave the ZX81 and move on to Tandy's well established TRS80 microcomputer. As usual, we start with an interface system, which is essential for serious music making control. Certainly, it's the most comprehensive that we've seen published for the TRS80 and includes address decoding for 24 input and 24 output channels, 8 channel multiplexed analogue input, analogue output, and digital inputs and outputs, e.g., LEDs and switches. The total cost is approximately £30 including the TRS80 interface cable.
The prototype circuit was wire-wrapped on a Vero DIP board and connected to the TRS80 via a 40 way ribbon cable terminated in an insulation displacement type edge connector (see parts list).
Channels 0 to 15 are decoded from the computer's IN and OUT signals with the required port address, 0 to 255. This is simpler than using memory mapped addressing with a Z80 based computer as less decoding hardware is required. A 74154 TTL 4 to 16 line decoder is used to select one out of 16 external devices. Channels 16 to 23 are decoded as shown in the circuit and are used for the analogue inputs, leaving channels 0 to 15 spare to use as required.
A TTL 74LS244 octal buffer, tri-state is used to interface TTL compatible signals to the input of the TRS80. For example, a SPST switch can be connected as shown, to set the bit to 1 or 0. One of the most simple and obvious applications is to use an external clock oscillator or controller (such as the Synclock or MF1) at one input port bit for setting the tempo of music and rhythms generated by the microcomputer.
A 74LS373, octal tri-state latch is used to interface devices to the output of the data bus. Two 7404 hex inverters can also be used to drive LEDs as shown - useful for confirming coding of output port lines to, for example, a drum generator board (such as in the E&MM Electric Drummer).
A ZN429 Digital to Analogue converter is wired as shown in Figure 1, to the interface. This device has an 8 bit input, lus settling time and typically 2.5V output which can be increased by use of an op-amp. For each additional analogue output a separate 74LS373 and ZN429 is used.
Several analogue outputs could be used for external synthesiser control of such sections as VCO, VCF, VCA etc. on a modular system. Alternatively, provided output voltages are programmed carefully, to match semitones, it's quite straight forward to match most synths CV in and TRIG in for computer control of your instruments (usually up to 5V output is required).
The circuit shown is a simple but effective multiplexing circuit connected to an 8 bit Analogue to Digital Converter. The ADC804 is a successive approximation ADC with 100us conversion time. The simple circuit is achieved by running the converter in the self clocking continuous converter mode. One out of eight output channels is selected from input ports 16 to 23 by software control, and the appropriate address is latched by the 74LS173D type register and the analogue multiplexer input is connected to the ADC.
There are obviously a multitude of possible applications in two main groups: the computer could be an intermediary between the musician and the control parameters of the synthesiser, in which case it can take over all the 'donkey work' such as remembering different settings, initiating sequences or controlling a number of events, at the touch of a button.
Alternatively, everything could be controlled by the software, the computer be- coming its own composer or the musician only controlling the general characteristics of the piece in progress.
Lastly, a completely new and very exciting field is open by connecting transducers of our bodily parameters like muscle activity, skin temperature, etc. There is already a large choice of 'biofeedback' sensors commercially available, which after processing could be used to control the synthesiser. Who knows? Maybe thought control isn't unreachable after all...
It should be pointed out that although this is necessarily limited in complexity, a first improvement could be to use one of the digital outputs to initiate the A to D conversion, thus eliminating possible erroneous readings that can arise if the computer reads data at an instant of transition.
30 PRINT A
40 FOR Q=1 TO 500:NEXT
50 GOTO 10
where B is input port; use ports 16 to 23 for analogue channels
10 OUT B,D
where B=port number: D=Data, D=0, all bits are 0, D=255, all bits are 1
Feature by Lyndsay Robinson
Previous article in this issue:
Next article in this issue:
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!