Have you run out of uses for your trusty Timex/Sinclair? How about a Field Day automatic CQ caller? Or perhaps a nifty way to call the maid in hopes of getting delivery of a cup of coffee?
Following is an economical speech synthesizer project that was done in order to earn an “A” in Professor Bo Barry’s Special Projects Class. He didn’t get to keep the project THIS time, I footed the bill for everything! The interface circuitry was based upon the articles that appeared in Radio-Electronics magazine a while back. If more info is needed on that project, send a long SASE (to Bo) and I’ll gladly send it. In addition to the speech synthesizer, I also built an electronic thermometer and a battery backup real time clock. Unfortunately, the semester finished before I got the clock working.
Details of speech synthesis will not be given here. (Bo has lots of info if you need it) Basically, the SP0256 (available at Radio Shack) models the vocal tract electronically. It can create 59 distinct sounds and by putting them together you can create an unlimited vocabulary. The chip can also be connected to ROMs containing a set of words, which it speaks VERY clearly. Following is the report that was submitted to Bo.
DESCRIPTION
The project that I chose to build was an SP0256 speech processor that could be interfaced to a Timex/Sinclair 1500 computer. The idea for the interface itself, including schematics, was taken from the July, August, and September 1984 issues of Radio Electronics magazine. The schematic and machine language program that allowed me to use the speech processor was modified from both Radio Electronics, and the technical data sheet for the SP0256.
In order to interface the speech processor to the Sinclair, I first had to build the interfacing circuit shown in figure 1. This was accomplished with six integrated circuits, a card edge connector, several feet of 30 gage wire, and a small piece of breadboard.
The Sinclair has an edge card on the back side of the computer with 44 connections. This gives access to all of the pins of the Z-80 microprocessor. Since using this edge card directly affects what happens to the microprocessor, timing and buffering proved to be very crucial.
Another problem with interfacing to the Sinclair is that there are two things that must be remembered when using machine language subroutines. 1)If you use the OUT instruction with an odd device code, the monitor system will crash. 2)If you use the IN instruction with an even device code, the top two data bits (D7 and D6) will be ignored. These two characteristics can be quite troublesome if they are not known.
THE INTERFACE CIRCUIT
The schematic of the interface circuit is shown in figure 1. This is how it works. Two sections of a quad OR gate (IC1) receive three control signals from the computer (WR, RD, and IORQ). It decodes these three signals such that when WR and IORQ are low, an OUT control pulse is generated. When RD and IORQ are low, an IN pulse is generated. These input and output signals initiate the data transfers. Each of the control pulses goes to a 74LS138 3-to-8 line decoder (IC3 and IC4). The 74LS138 inputs are connected to A2, A3, and A4 of the Sinclair’s address bus. This means that-assuming that A0, A1, A5, A6, and A7 are all logic low, that the device codes shown in fig.3 can be generated by the computer and be decoded by the 74LS138. IC2 and IC5 are both very important. They are bus buffers that protect the computer from damage resulting from wiring errors in the interface circuit. IC2 (74LS373) buffers the address lines and is unidirectional, while IC5 (74LS245) buffers the data bus and is bidirectional. The 74LS245 allows data to flow from the data bus to the interface circuit on all OUT instructions. But it only allows information to flow from the interface circuit to the computer on certain IN instructions. These IN instructions are determined by the IN address lines A2 through A4, and a decoder circuit constructed of IC6 and IC1. This buffer is used to interface the speech processor to the computer.
THE SPEECH PROCESSOR
Once I had the interfacing circuitry built and tested, I was ready for the speech circuit. The particular application that I chose to incorporate into my circuit required only six (6) address lines, one output line, and one input line. This allows the user to address all of the 59 allophones plus five pauses, for a total of 64 locations.
The speech processor circuits consists of a General Instrument SP0256 speech processor, an LM386 audio amp, a small speaker, a 3.12 MHz crystal, and several resistors and capacitors. The SP0256 connects directly to the interfacing circuitry, with only two signals necessary to control the circuit’s operation. An OUT (18) device code pulse loads the SP0256 with the address of the allophone to be addressed. An IN (14) device code pulse is used as an input to the computer to monitor the speech sequence.
The volume of the speaker is set via potentiometer R1.
The software needed to operate the speech processor circuit is as follows:
MACHINE CODE SUBROUTINE
MACHINE CODE MNEMONICS
DB 14 IN (14),A
E6 01 AND 01
CA 5020 JP Z, 2050
06 20 LD B,20
0E 67 LD C,67
0A LD A,(BC)
D3 18 OUT A,(18)
C9 RET
BASIC PROGRAM
20 LET A$=""
30 IF A$="" THEN INPUT A$
40 LET B$=A$(1 TO 2)
50 LET A$=A$(3 TO)
60 LET A=VAL B$
70 POKE 8295,A
80 LET B=USR 8272
90 GOTO 30
Line 20 of the BASIC program sets the string variable “A” (which represents the numerical value of the word or phrase that the SP0256 will be asked to speak) to zero. (A complete listing of the 64 allophones and their respective addresses is shown in Fig.5) Line asks the user to input the addresses of the allophones into the string. Lines 40 thru 70 manipulate the string variable “A” by some simple string slicing, and poke the first value into memory location 8295, where it will later be retrieved by the machine language subroutine that is called by line 80.
The first three instructions of the machine-language program repeatedly check the SBY (STANDBY. a logic 1 output indicates that the SP is inactive and a new address can be loaded) output of the speech processor to determine if a speech sequence has ended. This is done by generating an input device code pulse (IN A,14), setting all the bits of the accumulator to a logic 0 except D0 (AND 01), and asking the computer if D0 is a logic 1 or a logic 0 (JP Z,2050). If D0 is a logic 0, program execution returns to the beginning of the machine-language routine. If D0 is a logic 1, which means that the speech sequence has ended, the numerical value of the next allophone to be addressed is retrieved from memeory location 2067H (8295), where it was previously stored by the basic routine. That’s accomplished with the instructions: LD B,20 , LD C,67 , and LD A,(BC). Once the numerical value of the allophone is in the Z80, it is transferred to the SP by the instruction OUT (18),A.
With the data transferred to the SP, the speech sequence starts automatically. Program execution returns to the BASIC program in line 90, which repeats the whole process again, until the string variable “A” is equal to zero.
SCHEMATICS (FIG.1, AND FIG.2)

A4 A3 A2 DEVICE CODE (HEX) 0 0 0 00 0 0 1 04 0 1 0 08 0 1 1 0C 1 0 0 10 1 0 1 14 1 1 0 18 1 1 1 1C NOTE: A7, A6, A5, A1, AND A0 =0
PARTS LIST
Integrated Circuits IC1 74LS32 quad OR gate IC2 74LS373 octal D-type latch IC3 74LS138 3-to-8-line decoder/multiplexer IC4 74LS138 3-to-8-line decoder/multiplexer IC5 74LS245 octal bus tranceiver IC6 74LS11 triple 3-input AND gate IC7 SPC0256 NARRATOR speech processor IC8 LM386 audio amplifier Capacitors C1 .1-uf ceramic disk capacitor C2 .1-uf ceramic disk capacitor C3 .1-uf ceramic disk capacitor C4 .1-uf ceramic disk capacitor C5 22-pf ceramic disk capacitor C6 22-pf ceramic disk capacitor C7 .022-pf ceramic disk capacitor C8 .022-pf ceramic disk capacitor C9 1-uf electrolytic capacitor C10 10-uf electrolytic capacitor C11 100-uf electrolytic capacitor Resistors R1 100k 1/4 watt, 5% resistor R2 33k 1/4 watt, 5% resistor R3 33k 1/4 watt, 5% resistor R4 10k single turn potentiometer R5 10 ohm 1/4 watt, 5% resistor Other D1 1N914 low voltage diode Z1 3.12MHz crystal oscillator S1 small 8 ohm speaker

EVALUATION
I found this project to be a very interesting learning experience. I not only gained experience wire-wrapping and soldering, but also in troubleshooting and writing software. I found two errors on the schematics that I was using, and they caused me alot of grief before I found them. They were, however, easy to correct- so there were no extra expenditures that I had to make. All in all, I would say that this project is well worth anyone’s time that chooses to build it.
ALLOPHONE ADDRESSES (Fig.5)
OCTAL SAMPLE OCTAL SAMPLE ADDRESS ALLOPHONE WORD DURATION ADDRESS ALLOPHONE WORD DURATION 000 PA1 PAUSE 10MS 040 /AW/ Out 370MS 001 PA2 PAUSE 30MS 041 /DD2/ Do 160MS 002 PA3 PAUSE 50MS 042 /GG3/ Wig 140MS 003 PA4 PAUSE 100MS 043 /VV/ Vest 190MS 004 PA5 PAUSE 200MS 044 /GG1/ Got 80MS 005 /OY/ Boy 420MS 045 /SH/ Ship 160MS 006 /AY/ Sky 260MS 046 /ZH/ Azure 190MS 007 /EH/ End 70MS 047 /RR2/ Brain 120MS 010 /KK3/ Comb 120MS 050 /FF/ Food 150MS 011 /PP/ Pow 210MS 051 /KK2/ Sky 190MS 012 /JH/ Dodge 140MS 052 /KK1/ Can't 160MS 013 /NN1/ Thin 140MS 053 /ZZ/ Zoo 210MS 014 /IH/ Sit 70MS 054 /NG/ Anchor 220MS 015 /TT2/ To 140MS 055 /LL/ Lake 110MS 016 /RR1/ Rural 170MS 056 /WW/ Wool 180MS 017 /AX/ Succeed 70MS 057 /XR/ Repair 360MS 020 /MM/ Milk 180MS 060 /WH/ Whig 200MS 021 /TT1/ Part 100MS 061 /YY1/ Yes 130MS 022 /DH1/ They 290MS 062 /CH/ Church 190MS 023 /IY/ See 250MS 063 /ER1/ Fir 160MS 024 /EY/ Beige 280MS 064 /ER2/ Fir 300MS 025 /DD1/ Could 70MS 065 /OW/ Beau 240MS 026 /UW1/ To 100MS 066 /DH2/ They 240MS 027 /AO/ Aught 100MS 067 /SS/ Vest 90MS 030 /AA/ Hot 100MS 070 /NN2/ No 190MS 031 /YY2/ Yes 180MS 071 /HH2/ Hoe 180MS 032 /AE/ Hat 120MS 072 /OR/ Store 330MS 033 /HH1/ He 130MS 073 /AR/ Alarm 290MS 034 /BB1/ Business 80MS 074 /YR/ Clear 350MS 035 /TH/ Thin 180MS 075 /GG2/ Guest 40MS 036 /UH/ Book 100MS 076 /EL/ Saddle 190MS 037 /UW2/ Food 260MS 077 /BB2/ Business 50MS
DEVICE CODES
OUTPUTS
E1 AND E2 C B A 1 2 3 4 5 6 7 8 PIN NO.
1 X X X 1 1 1 1 1 1 1 1 15
0 0 0 0 0 1 1 1 1 1 1 1 14
0 0 0 1 1 0 1 1 1 1 1 1 13
0 0 1 0 1 1 0 1 1 1 1 1 12
0 0 1 1 1 1 1 0 1 1 1 1 11
0 1 0 0 1 1 1 1 0 1 1 1 10
0 1 0 1 1 1 1 1 1 0 1 1 9
0 1 1 0 1 1 1 1 1 1 0 1 8
0 1 1 1 1 1 1 1 1 1 1 0 7