+retroclouds Posted December 24, 2018 Share Posted December 24, 2018 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? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 24, 2018 Share Posted December 24, 2018 (edited) 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. COUNTER8.bin counter.a99 Edited December 24, 2018 by Asmusr Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted December 25, 2018 Author Share Posted December 25, 2018 Thanks Rasmus! Quote Link to comment Share on other sites More sharing options...
matthew180 Posted December 29, 2018 Share Posted December 29, 2018 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. 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.