From: "Francisco Pastor" Newsgroups: comp.os.msdos.djgpp Subject: RE: I need to advice on timing... Date: Mon, 31 Jan 2000 09:41:16 +0100 Organization: Telefonica Transmision de Datos Lines: 38 Message-ID: <873hoq$1q5$1@talia.mad.ttd.net> References: <3T6l4.3418$i43 DOT 21114 AT typhoon DOT southeast DOT rr DOT com> NNTP-Posting-Host: ppp168.aimme.es X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com pwillard escribió en el mensaje de noticias 3T6l4.3418$i43 DOT 21114 AT typhoon DOT southeast DOT rr DOT com... > I'm wondering if this is possible or not. > > I need to touch external hardware through the parallel port and so far, > doing that hasn't been a problem. Now, I need to control the timing of > signals sent to the external hardware. I can sucessfully create a 50 > millisecond pulse using the 8259 clock stuff, but I have no clue how to > generate a shorter than 1 millisecond signal. I now need a 10, and a 50 > MICROSECOND signal and I'm not sure if I can.... IS it possible? > Yes, is posible to increase the timer speed 65535 times faster. You only have to program the new timer divisor in the 8259 timer controler. The MSDOS set the timer counter with the 0xffff value. With a inferior varlue you get more ticks by second. I use the 8259 to get a 10 mseg. and 1 mseg. wide pulse and work fine. To do that you need: - Calculate the appropiate timer division. The base frecuency is 1193180 counts by second. So, with a counter divisor of 65535, you get the 18.2 ticks / sec. The shorter pulse is inferior to100 nanoseconds. - Know the register information for de 8259 chip - Program a timer interrupt handler. - Manage the interrupt controler to clear the timer interrupt. - Bypass to MSDOS timer handler interrupt an interrupts each 55 msec. if you are interested in use the MSDOS time services. If not, the time stop for the MSDOS. - When your program finish, restore all the changes. Good luck. Francisco Pastor