Magazine Archive

Home -> Magazines -> Issues -> Articles in this issue -> View


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).

Address Decoding

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.

Digital Inputs

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.

Digital Outputs

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).

Analogue Output

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.

Figure 1. Address decoder with ports for one digital and one analogue output.

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).

Figure 2. Eight channel analogue input.

Eight Channel Analogue Input

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.

Figure 3. Power supply, + 5V.

Figure 4. Input port.

Figure 5. Rear view of computer edge card.

Programs for the Interface

Analogue input

10 CLS
20 A=INP(B)
40 FOR Q=1 TO 500:NEXT
50 GOTO 10

where B is input port; use ports 16 to 23 for analogue channels

Analogue output

10 OUT B,D

where B=port number: D=Data, D=0, all bits are 0, D=255, all bits are 1


Resistors - all ⅓W 5% unless specified Maplin Code
180R 8 off (M180R)
1k0 1 off (M1k0)
10k 3 off (M10K)

15nF polyester 1 off (BX71N)
10uF 35V 1 off (FF04E)
470uf 25V 1 off (FF16S)

W005 Bridge rectifier 1 off (QL37S)
BZY88C2V7 zener diode 2 off (QH00A)
LED 8 off (WL27E)
UA78M05UC regulator loff (QL28F)
4051 BE loff (QW34M)
7404 2 off (QX40T)
74LS32 2 off (YF21X)
74154 2 off (WH08J)
74LS173 loff (YF73Q)
741S244 loff (QQ56L)
74LS373 2 off (YH15R)
ADC0804 LCN A/D converter 1 off (QQ00A)
ZN429 D/A converter 1 off (Ferranti)

40 pin IC socket 1 off (HQ38R)
40 way DIP jumper cable single ended 24" (Watford Electronics)
40 position card edge connector (Tandy 276-1558)

The above parts list is for the following port connections: 8 bit digital output, one analogue output, an 8-bit digital input and an 8-channel analogue input.

More with this topic

Browse by Topic:


Previous Article in this issue

Electric Drummer

Next article in this issue

Understanding Electronics

Electronics & Music Maker - Copyright: Music Maker Publications (UK), Future Publishing.


Electronics & Music Maker - Apr 1982

Scanned by: Stewart Lawler



Gear in this article:

Computer > Tandy > TRS-80

Feature by Lyndsay Robinson

Previous article in this issue:

> Electric Drummer

Next article in this issue:

> Understanding Electronics

Help Support The Things You Love

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!

Donations for December 2021
Issues donated this month: 0

New issues that have been donated or scanned for us this month.

Funds donated this month: £4.00

All donations and support are gratefully appreciated - thank you.

If you're enjoying the site, please consider supporting me to help build this archive...

...with a one time Donation, or a recurring Donation of just £2 a month. It really helps - thank you!

Small Print

Terms of usePrivacy