Mail Archives: djgpp/2001/03/31/23:17:29
Hi DJGPP friends,
I'm doing a real time app using DJGPP that runs for almost 2 hours polling
and
reading some hardware ports in loops of 50 usec (*micro*seconds).
I'm using the Pentium TSC counter to sync the data acquision since the RTC
and
system timer don't have this desired resolution or have some undesired
granularity.
The first problem i am living is to accurately calculate the CPU clock to
stablish the relationship between system clocks and real time.
The second problem is that (i think) PC hardware don't have any
stabilization
method for the CPU internal clock (Xtal voltage and temperature regulation).
So i think that the CPU clock may vary, but i don't know how much.
The third problem is about the TSC reading routine (RDTSC) and the 64 bits
arithmetic involved to calculate the elapsed time. They impact on the CPU,
but
i don't know how much. On a Pentium 100 system I estimated that RDTSC takes
from 12 to 24 clocks to finnish. And about the 64 bits arithmetic ? DJGPP
supports it, but i don't think that the operations are somehow hardware
accelerated. Am i right ? Are there any WWX (the oposite of MMX 8)
instructions on any Intel/AMD class processor that could be used by DJGPP or
inline assembler ?
Thanks in advance for all
And grettings from Brazil ! 8))
Eduardo TUDA DocHell Lorenzetti Pellin
PEA - Electrical Energy and Automation Department
USP - Politechnical School of Sao Paulo University - BRAZIL
http://www.pea.usp.br/~epellini
---------------------------------
And if you have a time to loose,
an open mind, and right to choose,
would you care to take a look,
or can you read me like a book...
time's is allways on my side...
--------------------------------- (Up the Irons !!!)
- Raw text -