Xref: news2.mv.net comp.os.msdos.djgpp:815 Newsgroups: comp.os.msdos.djgpp From: rhk AT farpoint DOT newimage DOT com (Ray Kelm) Subject: Re: Timer interrupts Organization: New Image Software, Inc. Message-ID: References: <4f2rto$dbp AT krel DOT iea DOT com> Date: Tue, 6 Feb 1996 03:26:23 GMT Lines: 41 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Larry Blanchard (larryb AT comtch DOT iea DOT com) wrote: : James T. Sweeten Jr. (sweeten AT belgarath DOT nwscc DOT sea06 DOT navy DOT mil) wrote: : : I have a question concerning the timer interrupt 8. : : What is the difference between the protected mode int8 and the real mode : : int 8? : : I need to output a value on a d/a board at specific intervals. I : : originally did this with borland by installing my own timer interrupt routine. : : I was able to get down to 100 micro second (10khz) resolution. I am trying to : : do the same thing using djgpp. I have read the faq and have also gotten : : pctime13.zip (This has milisecond resolution for djgpp). I modified the : : interrupt routines in pctime13.zip, (gccint8.c), to output the data to the : : d/a board ok but I can't get down to 100 micro second resolution. With an : : input value of 3000 hz I get a nice 1500 hz square wave. With a value of : : 4000 hz it works for a while but then locks the machine up. Any help would : : be appreciated. : : I am using 1.12m4 on a 486/66. : I recently had exactly the same need, tried just what you did (also on a : 2/66), and got almost the same results. Mine sometimes even hung at 3000. : Apparently, the overhead of the DPMI stuff is just too great for high : frequencies. I gave up on djgpp and did it in real mode. I can do 20Khz : with no problems. Try DJGPP 2.0, it works much better for interrupts. I have used 8Khz interrupts just fine on a DX4/100. The code in the interrupt does the following: reading and converting 6 10-bit absolute encoders controlling 6 stepper motors using step/dir bits complete with speed control and acceleration reading 12 16-bit force measurements from a DSP-based card reading 56 bits of digital I/O (sensors) from a PIO card All of this is in C, and is using approximately 50% of the CPU time. (The foreground task is using GRX to display all of this info, and control it) -- =========================================================================== Raymond H Kelm II New Image Software, Inc rhk AT farpoint DOT newimage DOT com Makers of Image BBS ===========================================================================