Jump to content

Photo

F18A high-resolution timer

f18a high-resolution timer

3 replies to this topic

#1 retroclouds OFFLINE  

retroclouds

    Stargunner

  • 1,705 posts
  • Location:Germany

Posted Mon Dec 24, 2018 1:57 PM

I noticed in the F18a spreadsheet that there's a high-resolution timer in the F18a.  At least that is what the F18a Status Registers SR3-SR11 indicate.

Is my assumption correct? Did anyone use this timer yet?  

 



#2 Asmusr ONLINE  

Asmusr

    River Patroller

  • 3,148 posts
  • Location:Denmark

Posted Mon Dec 24, 2018 4:38 PM

I noticed in the F18a spreadsheet that there's a high-resolution timer in the F18a.  At least that is what the F18a Status Registers SR3-SR11 indicate.

Is my assumption correct? Did anyone use this timer yet?  

 

 

I made a demo.

Attached Files


Edited by Asmusr, Mon Dec 24, 2018 4:39 PM.


#3 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Tue Dec 25, 2018 1:26 AM

Thanks Rasmus!

#4 matthew180 OFFLINE  

matthew180

    River Patroller

  • 2,632 posts
  • Location:Castaic, California

Posted Sat Dec 29, 2018 2:36 AM

The high resolution timer is still there, but I don't think it has been used outside of the demos Rasmus did.  The counter ticks every 10ns and counts in base-10, which I hope makes it easier to use.  The "seconds" part of the counter is a full 16-bit value, which means the count will roll-over after about 18.2 hours (65536 seconds / 60 / 60).  Since the time resolution is 10ns, the nanoseconds component will always be a multiple of 10, i.e. 10, 20, 30 .. 970, 980, 990, 0 ...

 

SR4..SR11 are used to read the various components of the count, i.e. SR5:SR4 are a 16-bit value that represent the number of nanoseconds from 0..999, SR7:SR6 are the microseconds from 0..999, SR9:SR8 are the milliseconds from 0..999, and SR11:SR10 are the number of seconds from 0..65535.

 

There are 3-bits in VR15 used to control the counter:

 

VR15, bit >40 is a self-clearing trigger that resets the counter, i.e. you set the bit to trigger the counter reset, and the bit goes back to zero automatically.  If the counter is running when the reset happens, it will be reset to zero and continue counting.  Resetting the counter to zero does not stop the counter.

 

VR15, bit >20 is a self-clearing trigger that grabs a snap-shot of the counter's value for reading via SR4..SR11.  This works just like the reset, and the bit will go back to zero automatically.  You must perform a snap-shot to update the value that is read back via SR4..SR11.  If you do not do a snap-shot, reading SR4..SR11 will always return the same values.  A snap-shot does not affect the counter's running/stopped status, and you can take a snap-shot while the counter is running if necessary.  Since starting/stopping the counters takes time, snap-shots allow you to grab time samples without effecting the counter and thus the accuracy of the timing.

 

VR15, bit >10 is the running / stopped status of the counter.  Set this bit to allow the counter to run, clear the bit to stop the counter.  Note: as mentioned above, you do not need to stop the counter to reset it or grab a snap-shot of the value.







Also tagged with one or more of these keywords: f18a, high-resolution timer

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users