delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/31/16:12:25

Message-ID: <368BE820.57A73CBC@gmx.de>
Date: Thu, 31 Dec 1998 22:09:52 +0100
From: Christian Hofrichter <ChristianHofrichter AT gmx DOT de>
X-Mailer: Mozilla 4.5 [de]C-CCK-MCD QXW03201 (Win95; I)
X-Accept-Language: de,en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: timing in u sec range
Reply-To: djgpp AT delorie DOT com

I had similar problems. Reading the timestamp counter is not so good, as
the values depends from the processor. ( it is increased every clock
cycle)
I have sloved the problem by reading out the port 0x40.
There you can read a counter,  coming from an quartz with 4,77
Mhz.(14.317.180 Hz)
After a division by 4 you get the counter-rate. The Timer-chip is called
8253/54.
But you have to set some values in port 0x40 before you can read this
port out correctly. (It would be good if you would have a port list
where the meanings of the ports are explained )
The counter runs down from 65535 to 0 an then it generates an interrupt
this is the time-base for the INT 0 and INT 8 handler which is called
something about 18 times per second (or every 55 milliseconds). So with
this counter you can  time in something about 800 or 900 nanoseconds !!!




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019