BMOW title
Floppy Emu banner

Audio Plans

Programmable Sound GeneratorsIt’s finally time to create an audio system for BMOW. There’s not much board space left, so this will likely be the end of the road as far as new hardware goes, save perhaps one or two miscellaneous chips. I’ve got space remaining for one more 0.6 inch DIP, or about six more 0.3 inch DIPs, depending on their pin counts. There’s also a spot where I’d planned to add a second SRAM, which is all wired up, but with some work it could be unwired to provide space for a second 0.6 inch DIP or two more 0.3 inch ones. This will be as much an exercise in space conservation as in hardware design.

I bought two 1980s-vintage programmable sound generators from www.arcadecomponents.com: an AY-3-8913 and an SN76489. The BMOW audio system will include one of these, with a minimal amount of extra hardware to support it.

SN76489

This chip was made by Texas Instruments, and was also known as the SN94624 as seen in the photo. It was the sound engine in systems like the TI-99/4, IBM PCjr, Tandy 1000, Acorn BBC Micro, ColecoVision, and Sega Master System, and first went into production in 1980. It has three tone generators and one noise generator. The tone generators create simple square waves at programmable frequencies and amplitudes. The tone frequencies have 10 bits of precision. Altering the envelope for a sound requires the CPU to rapidly change the amplitude for a tone generator.

The chip itself is pretty small: a 16-pin 0.3 inch DIP. The four voices are mixed internally and connected to an analog sound out pin. Interfacing with the chip looks pretty simple: it’s like a slow RAM, with standard chip enable and write enable inputs. It is write-only, and cannot be read. The only complication is that writes take 32 clock cycles to complete, requiring some extra hardware to latch the data and CPU control signals and hold them for 32 clocks.

AY-3-8913

The AY-3-8913 is a variant of the AY-3-8910, which was used in systems such as the Atari ST, Amstrad CPC, Sinclair ZX Spectrum, Intellivision, and Vectrex. It was also at the heart of the Mockingboard sound card for the Apple II family. It is similar to the SN76489, but a bit more capable. The AY has three voices, each of which can be mixed from one of three independent tone generators and a single noise generator. The tone frequencies have 12 bits of precision. The tones are simple square waves, which are then modified by a hardware envelope generator to create triangle waves, sawtooth waves, and other patterns.

The chip itself is a 24-pin 0.6″ DIP. There are quite a few useless pins, so minimizing size doesn’t appear to have been a design goal. The three voices are connected to three separate analog sound out pins, so some extra hardware is needed to mix them for a single speaker. Presumably this is some kind of op-amp circuit, but I need to research it. Interfacing with the chip requires mimicking the two-wire bus protocol for some long-dead General Instrument CPU. It can be read or written. The timing requirements for setup, write pulse width, and hold times are slow enough that some extra interface hardware would be needed, probably similar to that for the SN76489, maybe a bit more complicated.

Pros and Cons

The TI chip requires less board space, and looks a bit simpler to interface with. It has a single-pin, pre-mixed output. It might still require an op-amp anyway in order to drive a speaker, though. The AY chip has a hardware envelope generator, and better precision for the tone generator frequencies. It definitely requires an op-amp to mix the channels and drive a speaker.

I should really design it out in detail, but I’m guessing the interface hardware for the AY would require two or three extra chips. Because it’s a 0.6 inch DIP, and the way the remaining BMOW board space is organized, it would require a bunch of long wires (about eight inches) spanning the width of the board. In contrast, I think I could do the TI SN76489 hardware with a single extra chip, and fit it all in one area of the board.

The bottom line looks like the TI chip will yield somewhat poorer audio results, but will be simpler to get going. I’m leaning towards it for that reason. I still need to do some more research into the AY interface requirements, and figure out how to sum channels and drive a speaker with an op-amp, then I should be ready to make a decision and get started.

Read 6 comments and join the conversation 

6 Comments so far

  1. Gregg C Levine - January 11th, 2009 10:35 am

    OMG!
    I know both parts. For the TI one, be warned it can take time to produce the right sounds from it. For the GI one, it requires an entire computer PIO port to make it work, and then it becomes clear that you’re firing on all thrusters just to get it that far.

    BTW, GI was the mainstay behind the entire cable industry before they sold that line to one firm who got sold to Cisco, and by the way the cablemodem line got sold to Motorola.

  2. Steve - January 11th, 2009 11:19 am

    Any opinions on which one might be more suitable from BMOW? What is it about the TI part that requires a lot of time to get the right sounds– the need to manually control the envelope? Why do you say the GI part requires a PIO port? Is it impractical to just connect it to the CPU data bus directly?

  3. Steve - January 11th, 2009 12:23 pm

    I looked a bit more into what circuitry is needed between the sound generator’s output pin and the speaker or headphone jack, and I’m sorely confused. I knew I should have paid more attention in those signal processing classes at university!

    Surfing the web, I see everything from a single resistor between the output pin and headphone jack, to a complex circuit involving an op-amp or power amplifier and a dozen or more resistors and capacitors.

    My basic requirement is to get sound from a single 8 Ohm, 0.5 Watt speaker. It would also be nice to have a headphone jack, with the same audio going to the left and right channels, or maybe with different voices going to left and right in the case of the AY.

    The SN76489 datasheet says its output amplifer will generate up to 10 mA. I don’t know what the peak-to-peak voltage will be at the maximum volume setting. I’m fairly sure the output swings between + and – voltages, with an average of 0, rather than between 0 and some + voltage.

    The AY-3-8913 datasheet says each analog output will generate up to 2 mA. It doesn’t specify a maximum peak-to-peak voltage either, but says it has a max output of 60 dB, which I’m unsure how to interpret.

    Can I just connect either of these analog outputs straight to the speaker or headphone jack? Do I need some capacitors somewhere for filtering? Do I need an amplifier? Presumably I need some resistors for volume control, but I’m not sure if that should be inline with the speaker connection, or if I should construct a voltage divider between the analog output and ground, and tap that for the speaker connection. I’ve seen examples both ways.

  4. Gregg C Levine - January 11th, 2009 1:37 pm

    Hello!
    As for the AY part, it, ah, was originally designed to hang off of a PIO from any of six different original companies. A bus connection should work as long as you follow the part’s annoying timing sequences.

    But you are indeed getting it about that one.

    As for the TI part, it’s just designed to be difficult. Remember what it was originally designed for, then when you’ve got that concept down it becomes clear why it was designed to be difficult. For example, a related part the SN76494 who’s pin programmable rather then processor programmable, it travels down to for that one we need to pick the appropriate components to do the job.

    As for the sound output, accordingly, the way the majority of these things work is that a blocking electrolytic capacitor gets wired across the speaker, who then gets connected directly to the part. An external amplifier is sometimes desired in case the whole environment is noisy. Typically those devices are members of the LN386 family.

    And as it happens your information is indeed correct. I suggest you breadboard your way across each example.

    Now as to why you are confused, I suggest you check your ticket stubs on that concept, as in the expression, “Take an order mark.”. That because being confused about the whole activity is normal.

  5. John Honniball - January 14th, 2009 11:05 am

    You don’t need a PIO for the AY sound chip. I have one on my UK101, directly driven from the 2MHz 6800-style bus. You do need to generate a couple of bus-control signals that mimic the GI CPU’s bus (I think I used a 74151 for that). As for mixing the outputs, you can just connect them together since they’re open-drain signals. For a more sophisticated setup, you can make left and right stereo signals with a simple resistive mixing network. You will need a small amplifier (LM386) to drive a speaker.

  6. TRUE CHIP TILL DEATH » Big Mess of Wires - May 28th, 2009 3:05 am

Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.