delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/08/19:47:09

Date: Fri, 09 Jun 1995 10:14:58 +1100
From: Bill Currie <BILLC AT teleng1 DOT tait DOT co DOT nz>
Subject: Re: PC speaker
To: Ian Macky <imacky AT us DOT oracle DOT com>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Organization: Tait Electronics Ltd.

I just tested the code and it works perfectly.  Use whatever delay
algorithm you want. 

I've attached linkable source code for the routine, just pass trough
gcc then go32.  My biggest unsertainty was the exact function of the
two bits  Here is what i believe:

port 0x61
bit  function
 0   connect timer 2 output to speaker
 1   turn on speaker (must be on for bit 0 to have any effect)
2-7  irrelevant but don't touch as they control other things

toggling bit 1 while bit 0 is 0 can also create a tone.  If bit 0 is 
1 and bit 1 is toggled, more complex sounds can be created.

The defainitions of bits 0 and 1 may be reversed, but I don't think 
so.

In short, to get a simple tone, just set both to 1 ane to stop the 
tone, clear both to 0.

Have fun,
Bill.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019