View Single Post
  #5   Spotlight this post!  
Unread 31-01-2009, 20:49
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: Time precision better than seconds??

Quote:
Originally Posted by Joohoo View Post
For a while out team has been looking to use a timer. The timer works well, except we need to have a more precise timer than the one that the documentation says is available. Is there a way to make a timer that is more precise (milliseconds/microseconds)?
You can call vxTimeBaseGet(), which is a function provided in vxLib.

IMPORT void vxTimeBaseGet (UINT32 * pTbu, UINT32 * pTbl);

This function reads the 64-bit PPC timebase, storing the upper 32 bits at pTbu and the lower 32 bits at pTbl.

The least significant bit should be worth 1/132,000,000 of a second.
It would pay to do a little experimentation with it though, to see if that number is right -- it may actually be 1/133,000,000 seconds.
In any event, it's a very high resolution 64-bit counter.
Precise enough for ya?
Reply With Quote