The idea for this project fired in my mind when I was searching for some ICs in my spare parts box. I found two DS1669 electronic digital rheostats made by Dallas. I remember I got these way back in 2006 or so. I got them straight from Dallas as they were offering IC samples for testing purposes to anyone interested in their products. I remember I wanted a couple of them for the digitally controlled volume section of an audio sources selector. Honestly, when I submitted my request for these ICs to Dallas, I wasn't even expecting that they would reply back. To my amazement, they promptly replied that they have already sent me the samples I requested. Three to four months later, I got them in the mail.
The audio sources selector was a success. It worked as intended, and the electronic volume control was easy to use due to the fine adjustment over 64 incremental steps. I used the selector for some time, but at a later stage I bought a vintage audio sources selector. Then, I dismantled my DIY selector project and recovered the valuable parts. Thus, the DS1669 ICs went in my spare parts box to chill out for the next 15 years.
When I recently found them again, I just thought about using them somehow. So, I said to myself that being able to control the volume of the internal PC Speaker in my retrocomputers via software would actually be fancy enough to justify the need for a new project. This can only mean another ISA card that will employ these old electronic digital rheostat integrated circuits.
Here are the hardware specifications.
I initially wanted a simple design with only a few electronic components. Then, I quickly changed my mind and decided to build a more complex circuit that can accept a number of hardware commands, issued by software. These commands would then be passed to some sort of execution unit to change the volume according to what I specify in the software. While working on this new design idea, I ended up extending the hardware feature set. So I came up with two different signal paths. One for an internal PC Speaker and another one for an externally buffered line out circuit that just repeats the PC Speaker signal. Then, I advanced even more with this reasoning and added more features, such as relays for switching between amplified and non-amplified PC Speaker modes. And I even added the possibility to completely turn off the internal PC Speaker.
I decided to go for an 8-bit ISA card approach. That would be my first 8-bit card ever. So I am a bit excited about this. As the schematic grew up in complexity, the PCB space was quickly claimed by the handful of parts involved in the command processing and control circuits. As always, I went with a no cost reduction policy, and came up with a 4-layer printed circuit board with independent analog and digital power and ground planes.
This kind of project really needs no justification as I still play MS-DOS games that rely only on the PC Speaker for sound reproduction. Take for instance, Duke Nukem (Todd Replogle, Apogee Software, 1991) and Knightmare (Andy Zabolotny, FRIENDS Software, 1992). From time to time, I also like to play Pinball Fantasies (Andreas Axelsson / Ulf Mandorff, Digital Illusions, 1992) with PC Speaker sound. Being able to set the PC Speaker volume through software, without having to resort to manually winding or rewinding a potentiometer on the 80386DX ISA Single Board Microcomputer PCB assembly, was too good a motivation to continue with this project.
Even though my relation with the PC Speaker is one of love and hate, hearing these beeps still trigger a nostalgia feeling in my soul. So, here is another strong point for me to complete this card and to program the supporting software.
While I designed this project and (blindly) wrote the software back in 2021, I only had time to assemble the printed circuit board in mid 2023; an easy summer project, nonetheless. Unsurprisingly, both hardware and software worked as intended, first try; with a few hacks -- read-on for the entire story.
Disclaimer: I reserve the right to change the schematic diagram, the PCB layout, or the implementation without further notice. This is an entirely hobby do-it-yourself design and I am not responsible for any damage made by any possible mistake in any version or revision of the schematic diagrams or PCB layouts. Since it is an advanced microelectronics project, it requires very good assembly and debugging skills. In addition, I cannot offer any further technical support other than the contents of this article.
This project is in its final stage.
Current iteration of ASSY. 2486-SPKD-905 is VER. 1.2 REV. D
* * *
Laudatur ab his, culpatur ab illis. This project is provided as-is and is not for commercial purposes. It reflects my experimental work in microcomputer system design and should be treated as such. I release the schematic diagram and circuit board layouts to the public for educational purposes. I did all this at my own expense and in my free time. If you like my work, please consider making a donation. It helps me continue these kind of projects.
Fig. 1: Electrical Schematic Diagram
Fig. 2: Top Silkscreen
Fig. 3: Bottom Silkscreen
Fig. 4: Top Layer Printed Circuit Board
Fig. 5: Inner Bottom Layer Printed Circuit Board
Fig. 6: Inner Top Layer Printed Circuit Board
Fig. 7: Bottom Layer Printed Circuit Board
Fig. 8: Top Layer Printed Circuit Board - Simulation
Fig. 9: Bottom Layer Printed Circuit Board - Simulation
Here are the Gerber files compressed in a .ZIP archive.
Please note that the file naming convention that I used is what OSHPark normally expects.
You can also order the printed circuit board directly from OSHPark by following the link in the bill of materials below.
Compressed Gerber Files: isa-pc-speaker-driver.zip
The following list contains the parts that are required to assemble this ISA PC Speaker driver card.
|ISA PC SPEAKER DRIVER|
|Printed Circuit Board||ASSY. 2486-SPKD-905||1||VER. 1.2 REV. D||Order from OSHPark|
|IC2||74ALS27||1||Triple 3-input NOR Gate||595-SN74ALS27AN|
|IC3||74ALS138||1||3:8 Line Decoder||595-SN74ALS138AN|
|IC4, IC5||74LS123||2||Monostable Multivibrator||595-SN74LS123NE4|
|IC6||74LS07||1||Hex Buffer (OC)||595-SN74LS07N|
|IC7||74LS74||1||Dual D Flip-Flop||595-SN74LS74AN|
|IC9, IC10||DS1669||2||Digital Rheostat||Order from 3rd Parties|
|IC11||MC34119||1||Operational Amplifier||Order from 3rd Parties|
|T1, T2||2N3904||2||Small Signal Transistor||512-2N3904BU|
|D1-D6||1N4148||6||Small Signal Diode||78-1N4148|
|C1-C12, C39, C40||100 nF / 50 V||14||MLCC||80-C322C104M5R-TR|
|C13-C19, C24, C25||10 uF / 25 V||9||Tantalum Capacitor||80-T350E106M025AT|
|C20, C21||1 uF / 50 V||2||MLCC||80-C322C105K5R5TA|
|C22, C23||2.2 uF / 50 V||2||MLCC||80-C322C225K5R|
|C26||2.7 nF / 50 V||1||MLCC||80-C315C272K5R|
|C27, C28, C32, C33||1 uF / 50 V||4||Film Capacitor||505-MKS2B041001C00JS|
|C29||1 uF / 35 V||1||Tantalum Capacitor||80-T350A105K035AT|
|C30, C31||47 pF / 50 V||2||MLCC||80-C315C470J5G|
|C34, C35||220 nF / 50 V||2||MLCC||80-C322C224J5R|
|C36||470 pF / 50 V||1||MLCC||80-C315C471K5R|
|C37, C38||3.3 uF / 25 V||2||Tantalum Capacitor||80-T350B335K025AT|
|C41, C44||10 uF / 25 V||2||MLCC||80-C322C106K3R|
|C42||33 nF / 50 V||1||MLCC||80-C320C333K5R|
|C43||47 nF / 50 V||1||MLCC||80-C320C473K5R|
|C45, C47-C53||10 nF / 50 V||7||MLCC||80-C315C103J5R|
|C46||220 uF / 16 V||1||Polymer Capacitor||80-A750EK227M1CAAE16|
|R1, R2||33 kΩ||2||Carbon Resistor||291-33K-RC|
|R3, R4||180 kΩ||2||Carbon Resistor||291-180K-RC|
|R5, R6||1 kΩ||2||Carbon Resistor||291-1K-RC|
|R7-R10||470 Ω||4||Carbon Resistor||291-470-RC|
|R11, R25||4.7 kΩ||2||Carbon Resistor||291-4.7K-RC|
|R12-R14, R18, R19||47 kΩ||5||Carbon Resistor||291-47K-RC|
|R15, R17||22 kΩ||2||Carbon Resistor||291-22K-RC|
|R16||5.1 kΩ||1||Carbon Resistor||291-5.1K-RC|
|R20, R28, R29, R31, R32||10 kΩ||5||Carbon Resistor||291-10K-RC|
|R21||0 Ω||1||Carbon Resistor||291-0-RC|
|R22||16 kΩ||1||Carbon Resistor||291-16K-RC|
|R23, R24||47 Ω||2||Carbon Resistor||291-47-RC|
|R26||1.2 kΩ||1||Carbon Resistor||291-1.2K-RC|
|R27||10 Ω||1||Carbon Resistor||291-10-RC|
|R30||8.2 kΩ||1||Carbon Resistor||291-8.2K-RC|
|RN1||6 x 10 kΩ||1||Bussed Resistor Network||4607X-101-103LF|
|LED1||5 mm Green LED||1||Outputs Enabled Indicator||755-SLR-56MC3F|
|LED2||5 mm Green LED||1||Amplif. Enabled Indicator||755-SLR-56MC3F|
|LED3||5 mm Orange LED||1||Up Command Indicator||755-SLR-56DC3F|
|LED4||5 mm Orange LED||1||Down Command Indicator||755-SLR-56DC3F|
|IC Socket||14-pin||3||IC2, IC6, IC7||575-193314|
|REL1, REL2||A-5W-K||2||Miniature DPDT Relay||817-A-5W-K|
|JP1, JP2||3-pin Header||2||Jumper||649-68001-203HLF|
|J1, J2||3.5 mm Jack||2||Stereo, Switched||490-SJ1-3545N|
|BKT1||Keystone 9202||1||ISA Bracket||534-9202|
|Screw||Screw 4-40 X 1/4||2||For BKT1||534-9900|
Alternatively you can use the following link to the Mouser project that I created for this ISA card. It should make ordering of parts and removing typing faults pretty easy.
Mouser Project: ISA PC SPEAKER DRIVER
Lately I have observed that Mouser discontinued some of the parts in the list above. If you decide to build this project, then you need to find alternatives. It is out of my scope to maintain the correctness of the parts list above.
Here is a list of things you need to pay attention to should you decide to build such ISA PC Speaker driver card.
This 8-bit driver card is PC XT compatible by all means. The supporting software can be executed on any x86 microprocessor from an 8088 to a Pentium. Even a Core i9 would be able to execute the software as long as you run MS-DOS in x86 real-mode and there is a PCI to ISA bridge present in the system.
The PC Speaker driver card implements the following main circuit sections.
The principle of operation is straightforward. The software sends hardware commands to the card at the I/O address set by SW1 switches. The appropriate command process and execution unit receives the activation signal from the command decoder and sends an execution signal to the appropriate effector. The DS1669 ICs require a specific delay time to ensure the volume commands are registered internally. This delay could've been programmed in software but I decided to implement it in hardware instead. On the long run, I want to provide TSR capabilities to the software so that I can alter the PC Speaker volume on the fly, from within whatever game I am playing, through a specific key combination. That is why I didn't want to slow down the system with software delays.
The SPKD card contains only one command register that can be written. For the sake of simplicity I haven't implemented the capability to read the command register. I initially wanted to add some hardware identification method for software to be able to identify the card. I also wanted to be able to read the full status of the card. But the added complexity would've increased the PCB dimensions. And that would've been reflected directly in the price of the finalized card. Of course, I could've used a CPLD or a couple of PLDs. But I wanted to keep things simple.
There are four LEDs on the PCB that will be lit in certain conditions which are described below.
The analog section is pretty simple. It consists of a dual signal path, constructed around a bunch of operational amplifiers that carry basically the same audio information. The main difference is that one path leads to the internal PC Speaker header (amplified by MC34119) and the other path leads to the external PC Speaker connector (amplified by LM386). In addition, from the internal PC Speaker signal path, there is a derived branch that acts as a permanently connected, buffered line out circuit section. I thought that, at some point, I might want to record some PC Speaker game soundtracks. So this feature might come in handy.
And maybe a couple of words on the DS1669 linear digital potentiometers. The human ear perceives sound intensity on a logarithmic scale. A trained eye might be looking a bit suspicious at the way I connected the DS1669 ICs in the signal path. And for good reason. I simulated a pseudo-logarithmic potentiometer out of a linear one. The transfer function of this circuit is Vout = Vin * (Rvar / (Rs + Rvar)), where Rs is either R18 or R19, depending on which circuit branch we analyze. We can easily see that the amplitude of the output voltage can never reach the amplitude of the input voltage. But in this kind of circuit, you will never know this. Well, now you know it anyway.
By selecting different input series resistor values, you can obtain different shapes of the volume control transfer function. I prepared a chart where the log-linear type of the semi-logarithmic scale can be seen, based on five common resistance values. Assuming a theoretical input voltage of 5 V, in any case, the output voltage cannot reach the value of the input. Furthermore, it approaches Vin / 2 if using a series resistor value of 47 kΩ. Since electronics should be fun and educative, feel free to experiment. I went with a 47 kΩ part.
For the record, there is another way to create a logarithmic potentiometer out of a linear one. This method specifies a parallel resistor of around a tenth the potentiometer value, between the digital wiper output and the ground. I guess this method might give better results. However, the load seen in the following amplification stages is not constant. In this implementation, it might not matter, though. But that is a different discussion altogether.
The following section describes all the interface connectors and their respective pinouts.
|INTERFACE CONNECTORS DESCRIPTION|
|J1||LINE-OUT||Line Output||1 - Ground|
2 - Left Channel Output
3 - Right Channel Output
4 - NC
5 - NC
|J2||SPK-OUT||External PC Speaker Output||1 - Ground|
2 - Left Channel Output
3 - Right Channel Output
4 - NC
5 - NC
|J3||SPK-OUT||Internal PC Speaker Input||1 - Positive Output|
2 - Negative output
3 - Positive Output
4 - Negative Output
|J4||SPK-RPT||PC Speaker Repeater||1 - Speaker Data Output|
2 - NC
3 - NC
4 - VCC
|J5||SPK-IN||PC Speaker Input||1 - Speaker Data Input|
2 - NC
3 - NC
4 - VCC
I have provided some basic card configuration options under the form of jumpers.
The star (*) symbol signifies the default option.
|ISA CARD CONFIGURATION|
|JP1||RSTO||Reset Outputs||1-2: Enabled|
2-3: Disabled (*)
|JP2||RSTM||Reset Mode||1-2: Enabled|
2-3: Disabled (*)
The card will respond to a specific I/O address that is configured through the SW1 switch array. The card can be completely disabled by flipping SW1.1 to OFF. To enable the card, first flip SW1.1 to ON. The I/O address decoder will be accessible once the CPU takes control of the address and data bus. In other words /G signal of the 74LS688 magnitude comparer will be active when AEN is asserted low.
A combination of SW1.2, SW1.3, SW1.4, SW1.5, and SW1.6 will configure the address where the card will be mapped within the I/O space. Some combinations might generate conflicts with other ISA cards present in the system. So double check their actual I/O address ranges before configuring the PC Speaker driver card. The valid I/O address range is from 0x300 to 0x31F.
|I/O ADDRESS CONFIGURATION|
As I previously said, there is only one command register linked to the address decoder. So the ISA card will be mapped at only one single address within the I/O space. In addition, this register is write-only. Reading back from the register mapped at the configured I/O address will return gibberish data.
This ISA card has been tested with the following operating systems.
|ISA CARD OPERATING SYSTEM COMPATIBILITY|
|Operating System||Status||Driver / Notes|
|Microsoft DOS 6.22||Working||SPKD.COM|
|Microsoft Windows 3.1||Not Working||VXD driver is not available|
|Microsoft Windows 95||Not Working||VXD driver is not available|
|Microsoft Windows 98||Not Working||VXD driver is not available|
|Microsoft Windows 2000||Not Working||WDM driver is not available|
|Microsoft Windows XP||Not Working||WDM driver is not available|
I have set up a GitHub repository for the source code of this MS-DOS driver. The program allows the control of the output relay, switches between amplified and non-amplified PC Speaker modes, and ajdusts the digital volume control in amplified PC Speaker mode.
Since this is a very small program, I chose to write it entirely in x86 assembly language. Besides execution speed, which is out of question anyway on such a simple program, the main benefit is that the output executable file is only around 2.5 Kb. And since I like optimized code, you get the idea. If I were to write this program in Pascal, only the runtime code would've been about twice the size of my entire assembled program.
In other words, I also wanted to de-rust my x86 assembly skills. Naturally, I had a lot of fun programming this driver and I had to reference Michael Abrash's book a few times. I read it in the past, but a lot of sections were wiped from my memory throughout time.
GitHub Repository: https://github.com/agroza/spkd
Main Program: spkd.asm
Here is a picture of the software. Issuing hardware commands to the PC Speaker Driver ISA card is as simple as pressing the appropriate shortcut keys on the keyboard.
However, hardware commands can also be passed as commandline parameters, should you require this kind of flexibility. This way, you can automate the required command or sequence of commands directly from a batch file, maybe even from within autoexec.bat.
Finally, some two years after I designed this project, I have time to assemble this printed circuit board.
This is the bare 4-layer PCB, top side.
Followed by a bottom side view.
I soldered the smallest components first.
Two additional diodes are located by the switching relays.
Most of the resistors were installed in their respective places.
Followed by the ferrite beads.
Integrated circuit sockets were soldered next. The linear voltage regulator is installed as well. Some other small parts followed.
During the late evening, I continued the work on this circuit board assembly. Thus, I added the small-signal relays and some MLCCs.
Detailed view on the relays.
And a view on some of the passive RC networks.
I ended the evening by soldered some more capacitors.
The next day, I continued by adding the small-signal transistors, the LEDs, and the film pass-through capacitors.
I completed the assembly of the PC Speaker driver card by soldering the remaining components.
Next, I inserted the integrated circuits in their appropriate sockets.
A detailed view on the internal PC Speaker amplifier section.
And here is where things began to turn around. I inserted the card into an ISA slot and powered the computer. Smoketest passed ... without smoke. But, SPKD.COM behaved strange. Commands were issued, albeit in an erratic way. It took me just a couple of minutes to figure out that I messed the order of the D0, D1, D2 signals. These serve as inputs to the command decoder. I quickly corrected this mistake, in software.
Next issue was that the volume UP and DOWN LED indicators were always lit. A few more minutes into this problem revealed that I messed up the RC time constants for the second 74LS123 dual retriggerable one-shot IC. While here, I improved the RC time constants for the first 74LS123 IC that shapes the command pulses for both DS1669 chips. Retesting the card proved that it worked as expected.
Yet another problem surfaced quickly. While both OUT and AMP LEDs were correctly lit, their appropriate relay driving circuits were inverted. Thus, if the OUT LED was on, the output switching relay was off. Well, I easily corrected this issue by cutting two pins on the 74LS74 IC and adding some small wire connections on the back of the PCB. Works great.
While I had some Kemet 2.2 uF MLCC parts around, for the 1 uF I went with TDK MLCC parts instead, as I didn't want to wait for another Mouser shipment. As for the resistors, I went with what I found within my spare parts bin, in this case some Philips precision metal film parts.
Here is the modification on the solder side.
Some more tests revealed the last issue regarding the transition levels of the DS1669 control inputs. While the datasheet clearly states that a transition occurs from high to low and back, for some reason, I designed the circuit in reverse. Thankfully, this was easy to fix by cutting another two pins, this time on IC4. I soldered two additional wire straps on the back of the PCB. Another problem was solved.
If you don't look really close, you cannot even spot the cut pins.
And a view on the hacked solder side.
Finally, this time the card worked perfectly. All commands were executed correctly and the digital volume control worked as expected. Here's a picture with the completed card.
Let's see a different perspective view of the PCB assembly.
And a close-up on the linear voltage regulator section. The solid polymer capacitor is part of the LM386 external speaker coupling circuit.
Where would retro computer design projects be without control LEDs?
The following picture depicts a different perspective on the same circuit section.
And an overview of the soldering side, with the corrections. The modifications are small and I did them in a clean fashion; they appear to be as intended.
Let's advance with the mechanical card fixture. It's time to drill the Keystone 9202 steel bracket. I am not skilled in mechanical works and even though I correctly measured the drill points, the drill bit skidded and both holes got misaligned. Thus, I had to hack them with a Dremel tool. Now they're way too large but at least they fit the purpose. I think they're not even the same diameter :-) -- I know my limits. I think a 7 mm circular steel press would do miracles.
I attached the steel bracket to the card with Keystone 4-40 X 1/4 machine screws.
As I said...
I might redo the steel bracket at some point. But for now, it is as good as it gets.
And I added a prototype badge, complete with serial number, because why not?
I installed the card in one of my retro PCs. I got the video card out so that I can picture both the SPKD and AIF together. By the way, the audio interface can do software controlled volume adjustments over the PC Speaker signal path. But SPKD is a fancier and weirder piece of hardware.
Seeing the picture, I just realized that I forgot to solder the pull-up resistor array for the mainboard option ROM decoder circuit. And also I forgot about the steel bracket for the audio interface card. Great, more projects.
Under the AIF, there is my diy AdLib card, based on Eric Schlaepfer's reverse engineered PCB. Now there are three audio-related cards in the same PC.
Closing thoughts? As always, I learned new things on the way. And again, despite the time and care that I invested in this project, I still made a few mistakes. Fortunately, I was easily able to correct them. While the initial deception almost made me think I had to order new PCBs with the corrections in place, I analyzed the situation and came up with some elegant hacks that made this project successful, first try.
I don't think that I will produce a VER. 1.2 REV. D circuit board for personal use. But the project Gerber files and the schematic diagrams have already been updated to the latest revision. Should you venture into building this project, you don't have to implement my hacks in order to have a fully functional card.
This section lists the project version and revision history.
Copyright © 2004- Alexandru Groza
All rights reserved.
VER. 1.0 | REV. A