Based on the results of operating the first prototype of the device, a new final version of the device was developed, which completely satisfied me. I also built and tested a new prototype.
All features of the old version have been retained and new ones have been added. The values of some components were also clarified.
The mixer of Creative sound cards has too rough adjustment at the TAD and PC_SPK inputs, so potentiometer R7 has been added to more accurately adjust the volume level.
The duration of the timer pulse, which sets the duration of the speaker's activation after the computer starts or the reset button is pressed, is set by resistor R4 and capacitor C3. With the values indicated in the diagram, the duration is approximately 30 seconds (depending on the variation in capacitance of the capacitor). If necessary, the duration can be adjusted by the value of resistor R4.
I have found that the output level value of the speaker driver on the motherboard can in some cases change to the opposite after finishing some programs/games that use the speaker. That is, if before starting the program the output level was low, then after its completion it becomes high. Moreover, this does not happen every time, but occasionally. The reasons for this phenomenon are not clear to me. However, this gives rise to the problem of constant current flow through the speaker, especially since the device allows the use of increased power supplied to the speaker. Using a switched inverter at the device input does not solve the problem.
Therefore, the new version of the device uses automatic adaptation to the driver output level. If the low or high input level is held for more than 1 second, the device-controlled speaker, LINE_OUT and PC_SPK outputs are turned off. However, such a shutdown does not affect the useful signal in any way. The shutdown control is implemented using logic gate U1.2, which acts as a comparator with hysteresis. If there is a useful signal, a voltage of about 2.35V is established at the comparator input, which falls within the zone inside the hysteresis loop and false operation does not occur. The value of this voltage is determined by the circuit D3, R5, SD1 (must be a Schottky diode).
Sometimes I want to enjoy the “real” sound of the speaker while remembering the good old days, so I implemented the ability to programmatically turn on the speaker while simultaneously disabling the LINE_OUT output. The CTL input is designed for this capability. The permissible voltage level at this input is from -15V to +15V. Low level less than 0.3V, high level more than 3.5V or open collector.
Control is possible both from any GPIO device and directly from the COM port. Personally, I use a simple homemade GPIO board also connected to the COM port. Jumper J1 allows you to adapt the CTL input to any polarity of the output of the control device; to control from the COM port, it must be removed. If software control is not used, a jumper must be installed. Also, instead of a jumper, you can use a switch to manually turn on/off the speaker. The spk.com utility (located in the spk.zip archive) is intended for control via the COM port. The utility works in DOS and Win9x environments. Unfortunately, my knowledge is not enough to develop such a utility that will work in the Win NT family. Maybe someone can tell me how to solve this problem? Need a low-level driver? How to write it? Where can I find information about this?
The device can be used without connecting to the Reset input of the motherboard, relying on software control of the speaker. In this case, you need to provide some kind of connection to the computer ground, it is best to do this with a screw.
Jumper J2 determines whether the LINE_OUT output will turn off when the speaker is turned on or will be turned on constantly.
Jumper J3 limits the output power supplied to the PC speaker when using an amplifier designed to work with external speakers of several watts.
A sample sound of a melody from the game Supaplex is in the file supaplex.ogg, a sample PWM signal is in the file popcorn.ogg. The device does not introduce any additional noise into the output signal of the sound card via the LINE_OUT output, at least their level is much lower than its own noise. The PC_SPK output has a very low noise level, barely noticeable against the background noise of the AWE64 CT4520.