Mail Archives: djgpp/1998/12/31/16:12:25
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 -