www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/28/11:54:00

Xref: news2.mv.net comp.os.msdos.djgpp:3212
From: mhommel AT trumpet DOT aix DOT calpoly DOT edu (Michael Edwin Hommel)
Newsgroups: comp.os.msdos.djgpp
Subject: Help w/timer!
Date: 27 Apr 1996 15:59:40 -0700
Organization: California Polytechnic State University, San Luis Obispo
Lines: 28
Message-ID: <4lu8ss$2uc5@trumpet.aix.calpoly.edu>
NNTP-Posting-User: mhommel AT trumpet DOT aix DOT calpoly DOT edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

  Somebody please help me!  I am trying to reprogram timer 0 to run at a 
faster rate.  It works fine, unless I try to make it go very fast, in 
which case the machine hangs right at this code:

  counter=_PIT_freq/sndfreq; 
  outportb(0x43,0x34); 
  outportb(0x40,counter%256); 
  outportb(0x40,counter/256); 

  It works perfectly for sndfreq=200 Hz and below (well, okay, it works 
for 200, 70, and 35, for sure), but will not work for sndfreq=11000 or 
22000 (any wild and crazy guesses as to what I am trying to do?).  
Counter is an unsigned long.  I'm pretty sure the timer is allowed to go 
this fast (isn't it able to go up to a million hertz?), as I am working 
off of some PCGPE code (I'm trying to make a PC speaker .wav player), 
which does it.  I have tried with interrupts enabled and disabled, which has 
no effect.  Any help will make me disturbingly ecstatic.

by the way, #define _PIT_freq 0x1234DD

*****************************************************************************
* Jamul(ha-MOOL) aka Mike Hommel * "It's too bad that whole families have   *
* Head Honcho, Jamul Software    *  to be torn apart by something as simple *
* mhommel AT trumpet DOT calpoly DOT edu    *  as wild dogs." - Jack Handy             *
* http://ppp110.callamer.com     *                                          *
*********SPISPOPD VII: SPISHULK: THE SEARCH FOR BOUAPHA, COMING SOON!********


- Raw text -


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