Mail Archives: djgpp/1996/04/28/11:54:00
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 -