Well this was embedded in a Windows 3.1 app to supply some near to real time timings. I think he was using the Symantec C++ compiler at the time, but you'll have to check with him about that. Regards Stuart. -----Original Message----- From: WF AUTOMACAO To: PICLIST@MITVMA.MIT.EDU Date: 09 June 1998 22:59 Subject: Re: DS1307 on serial port or windoze timers >Stuart Broad wrote: >> >> Discussion on this thread pricked my memory about some techniques one of the >> windows programmers who works with me for generating real time timings for a >> life >> test rig we were working on. >> He forwarded this little snippet with an invitation to mail him if you need >> to discuss >> it any further. >> >> Regards >> Stuart Broad >> March, Cambridgeshire, UK. >> >> // This code uses the PC timer chip to delay for 100uS >> >> DelayFor100us() >> { >> _outp( 0x61, 0x40 ); // Disable the PC speaker. (Using channel 3 for >> timing) >> _outp( 0x43, 0x96 ); // Set timer register >> _outp( 0x42, 0x74 ); >> _outp( 0x61, 0x41 ); // GO >> >> while( _inp( 0x61 ) & 0x20 ){} >> >> while( _inp( 0x61 ) & 0x20 ){} >> >> while( _inp( 0x61 ) & 0x20 ){} >> >> _outp( 0x61, 0x40 ); >> } >> >> E-Mail me: martind@mcmail.com > >For D.O.S? > >Miguel. >