by Clive Jones
It's been a while since I wrote a technical article for the group. In looking for a suitable subject to cover, and I haven't yet done anything on sound generation, so we have this offering - Bally's AS-2518-61 aka "Squawk & Talk" sound module explained.
Your probably going to need schematics to follow what I'm about to tell you, otherwise you might get a little lost - you have been warned!!! This article assumes that you know something about how microprocessors work. We're really going to tear the Squawk and Talk board apart with this article - so get ready for some heavy "tech-talk"
Before I start, I would like to thank fellow Englishman and pinball partner Pete Clare for providing the data sheets on the TMS5200, TMS6100 phrase ROM and the AY-3-8912 PSG. This saved me from pulling half my hair out!
Few would dispute this speech and sound generating board is the best of it's generation (early 80's Bally pinball's) - I personally think it's something of a masterpeice with it's *very* clean design. The squawk and talk has 11 major IC's in it's memory map (count 12 if your board has a 6810 installed in the socket at U6). These are:
These aren't the only IC's on the board, they're just the most noticable. The others we will come to later.
*Note: As with Williams system6 and system7 pinball CPU and sound boards of the era, a Bally Sound board could be fitted with either a Motorola 6802 or a 6808 microprocessor. The 6802 chip itself contained 128 bytes of NMOS RAM that had to be selected by pulling the 'RE' (RAM Enable) line high. To use the 6808 CPU chip the RE line was grounded (via jumper "L") , and a 6810 RAM IC (128 bytes) at U6 on the Squawk on Talk board was used. When a 6802 is used the RE line is strapped to the reset line of the processor (via jumper "K") which is held high during normal operation.
S&T Memory Map.
S&T Power Requirements.
The +5 volts required for the logic and the positive rail for TMS5200/6100 is generated by the LM323 5 volt regulator VR1 (lower right corner of the board, the larger of the two heatsinks). This regulators input is supplied from the 12 volt unregulated supply which also supplies the power to the test LED. The same unregulated 12 volts is filtered by the 4700uF/25v capacitor at C14 to remove unwanted AC ripple and supply DC power to the TDA2002 mono power amplifier.
The 7905 (the "9" indicates negative voltage as opposed to a 7805 which is a positive 5 volt regulator) -5 volt regulator at VR2 provides the negative voltage to the split rail TMS5200/6100 IC's. It is supplied from the 6.3v lamp supply and is *doubled* and *inverted* on input to provide -12.6v. The 6.3 volt lamp supply is too low an input voltage for the regulator as it requires at least -7.5 volts on it's input to output a steady -5 volts supply. The -5 volt regulator does not require a heatsink as the only devices drawing on it are the TMS5200/6100 speech ICs.
It's always a good idea to transfer the data in those mask ROM's to EPROM and keep a binary file of the ROM image stored safely away somewhere (on your hard disk for example) if you have access to an EPROM programmer.
S&T Speech Generation.
The 5200 uses a method of data compression known as "pitch excited Linear Predictive Coding (LPC.) It can only process data compressed with this algorithm. Speech data held in the 6100 ROM or S+T EPROM(s) is compressed in this manner. The 6100 is connected directly to the 5200 which controls the addressing and fetching of speech data from the 6100 for internal processing after *first* receiving commands from the Squawk and Talk680x uP via the PIA at U7.
When Squawk and Talk is required to generate speech *without* the 6100 VSM in U9, the LPC encoded speech data is held in EPROM and accessed through the PIA to the 5200 VSP. With this method of data transfer, the 5200 is instructed to operate in a mode known as "speak external". In other words the uP says forget about getting data yourself from the 6100 VSM ROM (because it's not there), - I'll give you the data directly and I'll make all references to speech generation using the 6100 VSM from this point as it's a little more complex and less boring than refering to how the uP transfers byte-wide compressed data through a PIA to the 5200 VSP (but the 5200 processing description is the same no matter where the VSP gets it's data from).
The Squawk and Talk 680x has access to the 5200's internal address pointer, which it modifies to point at new phrases in 6100 ROM. The uP then instructs the 5200 to fetch data from that address and process it for output as speech. 6100 ROM speech data is received into the 5200 in *serial* form (one bit after another on the same line as opposed to 1 line for every bit) which undergoes serial to parallel conversion before being stored in the 16 byte internal buffer/stack. Amazingly, the 6100 is a 28 pin device but only 10 pins are used - the other 18 are *not* internally connected.
The TMS5200 is a microprocessor in it's own right. It handles data and addressing of the 6100 with minimal external uP interaction. It also provides the bus timing for data transfer to the 6100 for synchronous data transfer itself.
The TMS5200 is too slow to place directly on the 680x microprocessor bus. The 680x would be waiting for a response/acknowledgement (forcing a uP to wait in this manner is known as inducing a "wait-state") whilst it could be off performing other tasks. Therefore, a 6821 PIA is employed at U7 which acts as a parallel interface for the 680x uP to pass command/speech data.
Because the TMS5200 is not directly connected to the 680x address bus - it does not occupy address space, instead, only the PIA's address space (4 bytes) is visable to the uP as it's "in the way" of the path between the uP and the VSP. When the uP wants to talk to the VSP it has to do it through the PIA (the same thing occurs for the 8912 PSG as we'll see later). The 680x can write parallel (8 bit) command/speech data for the 5200 through the PIA (which then controls the hardware side of interfacing/handshaking with the 5200), and therefore, does not have to wait for a response. The 5200 interrupts through pin 17 - "INT" (interrupt) via the edge sensitive CB1 line of the PIA when it requires data to be transfered to it's internal stack, which in turn interrupts the 680x via the IRQ line.
The 5200 "excites" digitally encoded speech by using an internal digital filter to simulate the vocal tract of the human voice. The exact description of LPC encoding is not a trivial matter to put into easy to understand English if your not technically minded. The procedure (as with most speech processing) is a complex one, it goes something like this;
LPC synthesizes human speech by recovering from the *original* recorded/sampled speech enough data to contruct a time-varying digital filter which attempts to model the vocal tract of the human voice. This filter is further "excited" with a digital representation of either glottal air impulses (for voiced sounds) or the rush of air (for un-voiced sounds). The filter model is then passed through the internal digital to analogue converter which outputs the final speech waveform.
The 5200 VSP *does not* encode speech data "on-chip" (unlike the CVSD speech IC's we're used to seeing which can both encode and decode). A seperate program/hardware is required to perform the encoding by analysis of the speech samples.
The LPC analysis program begins with a set of digitized speech samples, which are usually derived by passing the analogue speech through an analogue to digital converter (ADC) at a sample rate of 8 or 10KHz. Consecutive samples are grouped together to form a "frame" of samples for analyzing - anywhere between 50 and 400 samples may form 1 frame, but typically it is 200 samples. The LPC analysis program takes each frame, then calculates the pitch, energy and spectral coefficient by *pre-emphasizing* the speech samples. The frames are then stored in serial data form within the 6100 VSM for recall or as parallel encoded speech data in EPROM.
This LPC method of speech encoding compresses speech data from 100,000 bits/sec (raw speech data) to about 4800 bits/sec. The analyizer program reduces this figure still further - to 2000 bits per second or less by cleverly taking *it's own* 10 bit speech parameters and compressing them to between 3 and 6 bit codes (depending on whether all the parameters were used - if the sound is voiced or un-voiced).
Speech encoded data received by the 5200 is then un-packed and tested internally for validity before having the energy, pitch and spectral data associated with the sample stored in RAM for the modelling/conversion to occur.
The internal 128 bit FIFO stack (First In First Out - also know as the "buffer") is arranged as sixteen 8-bit bytes to hold speech data passed to it/fetched from the 6100/S+T EPROM. As the data is pulled from the stack it is passed to the internal DAC for conversion to speech before being ouput as the final vocal phrase to the amplification circuits. If the 5200 stack decrements to 8 bytes or less (half empty), it raises an IRQ onto the squawk and talk 680x via the PIA to ask for a command to fetch more data (or speech data if in "speak external" mode).
The 5200 also raises an interrupt when either the 5200 has finished speech processing and requires more data to process from the 6100 ROM/S+T EPROM.
5200 interrupts: The 5200 asserts "INT" on three occasions but they are basically the same thing...
The three conditions above are given as flags in the 5200's internal status register which the 680x can read at anytime to establish the current condition of the chip.
This means that the 5200 data transfer by the Squawk and Talk 680x is "interrupt driven" - the uP on receiving an IRQ request from the PIA at U7 knows that the 5200 has processed data (the interrupt is determined by examining the PIA's internal interrupt flags) and the uP can transfer the next command/speech or modify the 5200's speech phrase address pointer and therefore, indirectly, speech data to it.
The conversion of speech data by the 5200 introduces an unwanted gift - "digital conversion noise", this is a very common problem when performing digital to analogue conversion of audio or speech data. To overcome the high frequency noise which has been superimposed onto the speech phrase, a "Low Pass Filter" (LPF) is used which attenuates speech phrases at a rate of 12db per octave above 5KHz. One quarter of U13 (one amp) - a LM3900 Operational Transductance Amplifier is used as a second order LPF. The speech is "cleaned up" and rounded off. I think this matches the speech bandwidth that Williams had at the time using CVSD technology (Continuous Variable Slope Delta modulation) - but don't quote me on it! The speech is then fed into a "voltage controlled amplifier" (VCA) at U14 (another LM3900 op-amp), to be, erm...amplified, before being further fed into the 8 watt TDA2002 mono power amp (U18) which drives the 8 ohm speaker.
The VCA's output amplitude can be directly controlled by a "control voltage" (CV) at it's input - hence it's name. The VCA control voltage is generated by the another amplifier in the LM3900 OTA at U13 which is acting as a DAC. The DAC's output amplitude is controlled by "weighting" it's input with four resistors in series with the PIA port B output at U7 (pins PB4 through PB7 to be exact). The 4 bit code passed to the DAC from the PIA allows for 16 steps of amplification which translates to 16 different speech output levels at the VCA, and ultimately, the power amp.
S&T Sound Generation.
Sound selection for the PSG is *not* made by S+Ts 680x - the "solenoid/*sound*
select" lines (the signal that also selects solenoids on the playfield
to fire via the driver/power regulator board) of the *MPU* board select the sounds
The PSG contains 3 channels for producing audio - A, B and C. In addition to these channels, the PSG also contains waveform mixers, a noise generator, and amplitude (loudness) control for each channel through independant DAC's that can have one of ten different amplitude envelopes applied to them. The 10 envelopes are all differing from each other, they simply raise, lower or sustain (hold) the volume, either repeating the nvelope or as a "one-shot" (once) operation. Adjustment of the envelope frequency is also provided. Repeatedly modifying of the waves amplitude without affecting the pitch is of course known as - amplitude modulation (AM).
The 3 audio channels are then summed together by linking the 3 output pins. The chip also contains a bi-directional 8 bit data port - used in Squawk and Talk to pass the incomming sound select strobes in it's I/O pins (input/output) to the S+T 680x via the PIA.
[The AY3-8910 used on earlier Bally sound boards have exactly the same internal sound generating architecture as the 8912, with the exception that the 8910 is a 40 pin device and contains two 8 bit I/O ports.]
The 8912's 16 internal registers and they're permissable values are:
(you'll notice two port enable bits - as previously mentioned the 8912 has the same architecture as the dual port 8910)
The U11 PIA on the *game* MPU board outputs the sound (solenoid) select signals. All the incomming signals are inverted on Squawk and Talk by a CMOS 4049 hex inverter at U16 before ending up as a 4 (or 5 bit) bit binary code on the AY3-8912's I/O port pins IO0-IO4. (There are eight I/O lines but IO5-IO7 are not used - they are grounded.). Squawk and Talk knows of an incomming sound request as the PIA at U11 interrupts the 680x IRQ line (Interrupt ReQuest) after receiving an interrupt on it's own CB1 line. The "solenoid/sound select" line of the game MPU (J1/10) which is connected to the PIA at U11's CB1 pin is forced high by the game MPU board - this forces a *low* IRQ interrupt on Squawk and Talks 680x via the one of the inverters at U16 (pin 2 - inverted output of the "solenoid/sound select" line from the game MPU board). The interrupt forces S+T to look at the I/O input port register (14) of the PSG (via port A of the PIA) and read the code presented by the MPU board, which is then transfered by the S+T 680x for decoding.
Bally state: "The code number of the sound/speech required is passed as two half-bytes (nybbles - 4 bits) over the solenoid select lines which are the sound select inputs to the Squawk and Talk". So, when a solenoid is required to fire as a result of a valid switch closure detection on the playfield or in the cabinet, the game code would pass a "sound code" associated with the solenoid to the Squawk and Talk board in binary format. board).
<Techie timing bit - crash helmets on!>
Data transfer of the two 4-bit "code" nybbles to S+T is synchronous with no "data taken" handshake back from S+T indicating it has received the data. The sound select interrupt that arrives on the CB1 pin of the PIA at U11 is low for 40 microseconds, before going high again. Following a 22 microsecond delay (probably due to the time the S+T uP has to process the interrupt service routine), the first nybble is presented by the game MPU on port A, which S+T must take within 145 microseconds. The second nybble is sent immediately afterwards but only lasts for 78 microseconds. If S+T does not take the data within the specified time (say, it only gets the first nybble because S+T the bus is running slow due to failure) - S+T may actually play the wrong sound!
<End of techie timing bit>
Note: The same lines 4/5 lines passed from the game MPU through the PSG are also used to select *speech*.
Strangely, the schematics that I'm checking against show a *fifth* solenoid select line wired to PA4 (if the "EE" jumpers are installed, which, we'll come to shortly) or IO4 of the PSG. Maybe Bally kept their options open by keeping this fifth solenoid select line available on S+T?
More probably - bit 5 of this line is present to pass *command* data from the *game* MPU 680x to the Squawk and Talk 680x. At power up the game MPU board passes a basic code too S+T to enable it to initialize the onboard VCAs to a predefined level of amplification - this level is user changeable through an audit as part of the coin door tests. Consult your game manual for the exact audit parameters. This begs the question "what other command codes are passed from the game MPU uP to the S+T 680x?". 256 command codes are possible using the two 4 bit nybbles in conjunction with the 5th line - the 5th line signals "command code" rather than "sound/speech code". Total number of codes possible then is 512 - 256 sound/speech and 256 command. This of course is pure speculation on my part, and, only hacking game code or talking to S+T's hardware/software engineers will provide the answer.
When S+T has the sound/speech select code, it changes the state of the PIA's port A from input (sound/speech code read) to output so that it can write the command data to the PSG which will then generate tones/noise. (This isn't done of course if S+T is only required to output speech.). The PSG has internal latches to, err.....latch the tonal data it generates and therefore sustain the sound without the S+T 680x having to refresh pitch command data to it in order to keep the sound playing. S+T will continue in this fashion until either the sound routine ends (it's finished) or it is interrupted and forced to play another sound. Unlike modern games, S+T (as far as I can tell) has no sound *priority* - all sounds are equal and the previous sound will be cut-off and a new sound played on receipt of a new sound interrupt.
The AY3-8912's analogue output is filtered with yet another LPF (the last quarter - one amp of the LM3900 at U13) which has a cut-off frequency of 3.5KHz and a roll-off of 12db/Octave as with the speech filter design. The filter is in place not to eliminate conversion noise (that's done "on-chip") but to round off/soften the harshness of the square waves being output making them more pleasant to the ear. The filters cut-off frequency is fixed at 3.5Khz but the PIA at U11 is able to kick-in a 2n3904 NPN transistor (Q2) which drops the frequency to an low cut-off of 200Hz for special audio effects.
It's a shame that Bally's S+T designers did not add programmable resonance control or low frequency software controlled modulation to the filters. Making them 2/4 pole switchable with a 12/24db per octave roll-off could have extended to tonal capabilities *far* beyond what they are now and would have blown the nearest pinball audio technology at the time clean out of the water.
2 - As the PSG is limited to generating square waves or noise the Sound ROMs contain additional wave data/wave generating algorithms that the 680x can shove through a digital to analogue converter for audio processing without the interaction of another PIA. The 680x is able to do this because the DAC in question (U10 - AD558) will interface directly with the 680x bus (it has a "chip select" pin and 3 state data lines) and sits on the data bus. This method of reading wave data from ROM and shoving it through a DAC is similiar to what Williams did at the time with it's sound with the exception that Williams used a PIA between the wave data and their 1408 DAC. Note also that the output of the AD558 DAC is clean enough not to be filtered and enters the amplifier circuit at the VCA input stage of U14 (between the AY3-8912 LPF output and the VCA).
Five jumpers - "EE" are used to connect the sound/speech select strobes directly to the PIA A port when the AY3-8912 PSG is *not* installed in S+T. With this configuration, the sounds are generated soley by using software generated waves and effects through the DAC. The PIA at U11 interrupts the 680x after receiving a request from the game MPU board as previously discussed. This forces the 680x to look at the PIA port A lines *directly* and take the four (or 5 bit?) code presented on the pins over two nybbles.
S&T Gain Control.
Bally give you the option of disconnecting the local speech pot (R69) and the sound pot (R70) or the VCA's (if connected) with wire jumpers so that remote 1k pots can vary the speech/sound gain and mix. Remove jumper "m" and install jumper "n" for the remote speech pot and remove jumper "cc" and install jumper "dd" for the remote sound pot. If you so wish, you could disconnect both R69/70 *and* the remote pots in the cabinet/coin door and control the amplification/sound+speech mix by audits alone (VCA control).
As with the AS2518-xx MPU boards, Squawk and Talk's PIA's are wire OR-ed together. The internal interrupt flags of both the PIA at U7 and the one at U11 need to be examined by the 680x to determine which PIA was making the request.
S&T's Other Circuits.
Fortunately Bally got rid of the two phase clock generator and clock buffers using multivibrators used on previous 680xd based boards and replaced them with a 3.58Mhz crystal oscillator wired between pins 38 and 39 of the 6802/8. This makes fault finding the clock signals significantly easier (check the clock directly at the 680x pins).
The 74LS155 at u17, a dual 2 of 4 decoder/demultiplexer, is used to generate chip select signals for all the memory mapped devices (ROM's, PIA's, DAC) on the bus by decoding address lines A11-A15 in conjunction with the VMA (Valid Memory Address) signal ouput by the 680x (pin 5) on either a read or write cycle. The 6810 RAM at U6 ($00-$7F) also uses this address decoder. It is automatically *deselected* when A7 goes high ($xx8x) and when the address on the bus *exceeds* $0FFF (1st 4 k boundary - start of DAC address space). The 680x does not need to issue an address onto the bus when the internal RAM is selected using a 6802, therefore the address decoder has no bearing. No bus drivers are used on S+T as only one device will be active on the bus at any one time, and the 680x has adequate power to drive the one TTL load each device will represent (the other devices will be "tri-state" - in "standby").
Some well known US pinball repairers have capacitor replacement kits available (and I'm not sure all the caps I've listed are in the kits). In the UK, you can get these common electrolytic caps from RS components, Maplin and possibly Tandy (I get mine in work!). The 16 *axial* capacitors in question are
A word of WARNING: Nearly all capacitors today have the *negative* terminal marked with a black arrow on the capacitor can. On S+T the opposite occurs. I've just looked at two boards and the old capacitors are marked showing the *positive* terminal, the board also has the positive terminal silk screened on it's surface. MAKE SURE YOU GET THE POLARITY CORRECT!
If you insert a capacitor around the wrong way then apply power (give it a reverse voltage) the dielectric will be removed from the anode and a *large* current will flow as oxide builds up on the cathode. This causes a gas build up and that's what makes the cannisters EXPLODE!
S&T Self Test.
For some reason better known to Bally, the ROM's do not appear to be tested - there is no provision for them in the self-test. Whether they are actually tested by checksum for validity, but not displayed as part of the test, remains a mystery. In this case, it is probable a board could pass the test but output bad audio data or run corrupt operating system code! It could even run a corrupt self test routine!
After power-up and the correct reset timing/voltage regulation, the LED briefly flickers (for approx 300 milliseconds). This happens because the LED is by default "on" (at power up) and the software must turn the LED off. So after the initial flicker you get the diagnostic flashes. U1 requires +5 volts to be applied before the reset line is allowed to go high. If this condition is met, the LED does a quick "flicker". At power-on, C1 slowly charges via R1. The voltage across C1 is monitored by U15. When it reaches 1.7 volts DC, U15 take the reset line high. Diode CR1 across R1 provides a quick discharge path for C1 in the event the +5 momentarily disappears.
If you have a 6802 installed in your S+T then the *internal* 128 bytes of RAM are tested and *not* U6 providing the 680x's RAM Enable line (pin 36) is strapped high (to the reset line) via jumper "k". The software doesn't care where the RAM is physically, as long as there is RAM at page zero (it's transparent to the software). The test program attempts to write a bit pattern to address $0000, starting with $00 and counting upto $FF. If the test program sucessfully manages to write and then read back (validate) the count, it then moves onto the next byte $0001, until all 128 bytes have been checked. 256x128 = 32,768 write cycles with validation. If this is sucessfull, the LED flashes for the *first* time (the initial flicker is not counted as a flash).
If your using a 6802 and the RAM test fails (you don't get the first flash) - you might be lucky. Move jumper "k" (the internal RAM enable jumper) to position "L" and install a 6810 RAM IC in U6 then run the test again, else, you'll need to change the 680x (the internal architecture is damaged).
An interesting point here. Joel and Vickie (the Pinball Liz) listed a problem in their tech tips #34 with the self test button on S+T not being debounced which sometimes causes the board to crash after attempting a test. Because the switch is not debounced, the switch contacts make and break a number of times translating to a *number* of valid NMI requests to the 680x. The *stack* and *workspace* RAM in S+T is only 128 bytes wide (page zero $0000-$007F, the exact stack length is unknown to me). The 680x has to save the contents of it's internal registers onto the stack when it encounters an NMI (or IRQ) interrupt. A number of interrupts recieved in this manner will cause "nesting" (interrupts are "queued" to be processed in last in first out [LIFO] order) and the most probable cause of the board crashing is the stack overflows, wraps around, and starts to overwrite itself wiping out the data previously saved onto the stack. The conclusion? The uP crashes because it pulls data off the stack that didn't match the data it originally saved. Power-cycling is the only option to clear the problem (there is no reset button on S+T). The problem is further agrovated by the fact that speech data transfer requires an IRQ interrupt - further stack usage translating into IRQ and NMI data colliding caused by the over-write when the 680x "pops" (pulls data off) the stack.
[Bally state: "Every time a write to the speech chip is performed, the speech chip responds with an acknowledgement".]
Note that Bally's test documentation is misleading here because it is so vague. The 5200 *does not* acknowledge every byte sent to it except in the above case. That is, if the buffer contains more than 8 bytes it will not assert "INT" and therefore will not acknowledge. If the buffer is at max (16 bytes) it changes the state of it's "ready" line (pin 18) connected to the PIA effectively telling it not to pass more data until the 5200 asks for it (it's "not ready").
If the test is successful the LED flashes for the fifth and final time and the PIA's are initialised to their correct configuration in readiness for game operation (waiting for a sound select interrupt from the MPU board). If the test fails then swap out the PIA for the reasons indicated in the 4th flash test above, else, swap out the 5200 and/or check the sockets. Check the state of the 5200 supply pins (pin 4 - [+5v], pin 5 [-5v]) as the power sequencer circuit may be faulty. It is also possible for a faulty 6100 phrase ROM to "pull-down" the 5200 and may be worth swapping out if all else fails (that's if it's installed of course!).
No Fifth S&T Flash on Fathom (and some other games).
Note, that for S+T to actually test tha PIA's they have to be intially configured/programmed by the 680x *before* they are tested. PIAs always default to port A, B, CA2, CB2 as inputs and all interrupts are disabled at power up. This is no good as the self test requires CA2/B2 to be tested as *outputs* by writing to the port output registers for both the PIA at U7 and U11. Therefore, they will require re-configuring after internal intialization out of reset.
Well there you have it, the Bally Squawk and Talk sound board explained in detail.