From: alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams) Newsgroups: comp.os.msdos.djgpp Subject: Re: timer interrupt - sample code anyone? Date: Tue, 22 Apr 1997 18:00:11 GMT Message-ID: <335cf97e.3851578@news.demon.co.uk> References: <199704221040 DOT MAA11513 AT gilberto DOT physik DOT rwth-aachen DOT de> NNTP-Posting-Host: abwillms.demon.co.uk Lines: 40 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 22 Apr 1997 10:40:27 GMT, Christoph Kukulies wrote: >I need a (relatively fine grained) time base and I'm thinking of using >the system timer chip for this purpose. Never programmed that chip >before and never dealt with hardware interrupts under djgpp. >Can anyone point me to some sample code? >The timer should interrupt at a rate of 10 KHz and the interrupt >service routine is just supposed to increment a global 32 bit value. >Hope, the 10KHz doesn't bring down the overall system performance. ACTUALLY, you'd probably be better programming the timer chip to count for you - leave the system timer alone, use the speaker channel; it can be disconnected from the speaker, set to count, and cleared. Time passes. Read the timer. Tadah! Think that'd be awkward to do? Well, look up uclock() in the info pages! ABW -- "Plug and Play support: WfEWAD will autodetect any installed Nuclear Arsenals, Laser Satellites, Battlefield Control Networks, Radar Installations, Fighter Squadrons, and other WfEWAD compliant devices, including the new Macrosoft Unnatural Keyboard, with full support for the now-famous Big Red Buttom(tm)." (Windows for Early Warning and Defence User's manual P26) Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk Hello :-)