Page 2 of 2

Re:RDTSC for measuring time

Posted: Thu May 27, 2004 3:38 am
by Candy
hsimola wrote: Those other things you mentioned goes too diffcult for me.

I have PC's from Pentium II to Pentium 4, mostly laptops.
they involve ripping out your processor and soldering on it, so it's probably out of the question anyway.

Can't you make an external card containing its own counter etc. all working at 4mhz or something, and then clock its count in the processor? say you make the input connect to the invert-input on a flipflop that controls the enable-pin of a 24-bit counter, and when you get the disable-signal (inverse of enable) you start sending the count. That no idea?

Re:RDTSC for measuring time

Posted: Thu May 27, 2004 3:50 am
by hsimola
Yes, that's also good idea. But I would like to work only with PC, not external cards.

What is your final opinion about STROBE pin compared to ACK pin or serial port pins ?

PS. I am starting developing Microchip PIC based external card, but it will take time when it is ready. So, I try with PC first.

Re:RDTSC for measuring time

Posted: Thu May 27, 2004 3:55 am
by Candy
hsimola wrote: Yes, that's also good idea. But I would like to work only with PC, not external cards.
Most people don't notice when you have a very small control thingy in your connection cable :) And then again, you can make it so small you can put it inline in a small box... does cost some more...
What is your final opinion about STROBE pin compared to ACK pin or serial port pins ?
I don't know if ACK will be fast enough, but I guess they're both equally fast. The strobe pin might have a slightly faster response because the data must be read within a microsecond, but I think ACK also has that.

Re:RDTSC for measuring time

Posted: Thu May 27, 2004 10:16 pm
by Brendan
Hi,
hsimola wrote: Frequencies I feed to serial port CTS pin are between 10-100Hz.
I don't see anything wrong with using CTS for <= 100 Hz....

As I mentioned you should be able to get 0.001 uS resolution using RDTSC, so I guess the question is, why isn't your original code this accurate?

To start with your first measurement should be discarded, as it will measure part of a cycle rather than a full cycle. You could wait for a rising edge before you start counting to remove this problem.

Other than this your accuracy will depend on how you calibrate RDTSC, how you interpret the results, and if your CPU's/RDTSC's clock remains at a fixed frequency (it can be messed up by automatic thermal monitoring, but it's unlikely).


Cheers,

Brendan

Re:RDTSC for measuring time

Posted: Fri May 28, 2004 10:16 am
by hsimola
Yes, that's true, first RDTSC value should be discarded.

But I use array where I store values. So, only in array[0] is wrong value.

Running out of ideas...